Is the new React use hook a footgun?

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 165

  • @dominicanfrankster
    @dominicanfrankster 2 года назад +2

    You see a new video from Jack in your feed, you click it. I will not be taking any questions.
    Thanks again for your almost eerily clear instruction, like you're injecting the information into my brain! 🙏

  • @zombiefacesupreme
    @zombiefacesupreme 2 года назад +25

    So glad you covered the fact that React Query and SWR still have a place in the world. Data Caching is still a thing.

    • @samu350
      @samu350 2 года назад

      Yea, also the fact that React Query has such good defaults can't be overlooked.

    • @NateLevin
      @NateLevin 2 года назад +1

      Also retrying, offline support, optimistic updates, etc etc

  • @alexrusin
    @alexrusin 2 года назад +2

    Long time listener first time caller. What we are battling with on the frontlines is proper error handling. You always kinda do the happy path in your videos. I wonder if you can sprinkle in some error handling here and there.

    • @jherr
      @jherr  2 года назад +3

      It's tough to do that and keep the videos succinct, but I get where you are coming from and I'll try to do more to add the error handling around the main subject of the video.

  • @yihad3255
    @yihad3255 2 года назад +4

    Great video! So hyped about the ergonomics of async server components. Hopefully the upcoming cache RFC addresses the concerns with cascading.

  • @box4soumendu4ever
    @box4soumendu4ever 2 года назад +1

    Sir, you are a fantastic tutor and very lucky to have a voice quality like a great teacher, 😊😊👍👍which is very important. Please continue 👏👏

  • @neociber24
    @neociber24 2 года назад +65

    I would like they named it "usePromise" or something like that

    • @SamyarBorder
      @SamyarBorder 2 года назад +1

      Actually I prefer use (like use(posts) ) but I haven't tried it yet so maybe i feel the same way when I got into coding

    • @alanhoff89
      @alanhoff89 2 года назад +2

      useFuture

    • @dericksonloss
      @dericksonloss 2 года назад

      Can't you always write a wrapper function for the "use" hook and name it "usePromise"?

    • @alanhoff89
      @alanhoff89 2 года назад +4

      @@dericksonloss also known as aliasing

    • @unnoticedspacegoat8537
      @unnoticedspacegoat8537 2 года назад +3

      Because they are planning to support types other than Promise like Context, streams etc.

  • @JohnPywtorak
    @JohnPywtorak 2 года назад +1

    Thanks, clever that the cache is caching a Promise that use resolves. Good place where Typescript would make that clearer, suspect initial look at the code a person would assume it is holding json and not a Promise.

  • @AlexUnderCMYK
    @AlexUnderCMYK 2 года назад +8

    Svelte is really setting the pace. Good to see React coming along.
    Great video as always ❤️

  • @beep1677
    @beep1677 2 года назад +1

    Very informative video, looking forward to trying out 'use' in my projects.

  • @dinguskhan8883
    @dinguskhan8883 2 года назад +9

    I believe it’s recommended to use useCallback to wrap the function that goes into use() which makes it pretty clean.
    Also I find it a bit weird that a promise (idsFetch) is hanging outside a component like that, maybe it was meant to be a function. WDYT?

    • @andreicojea
      @andreicojea 2 года назад +4

      Let me see if I get this right 🤔 If you put the promise into the component, it gets recreated every time the component renders. If you put it outside as a function, then again, calling that funtion recreates the promise. What I see here is that the promise is created once, and used as a reference inside the component. I imagine you can do some smart tricks with hooks inside the component, maybe use useCallback or useRef, to prevent recreating the promise, but this shows that not everything has to live inside a component, and it made quite much sense to me 😁

    • @majorhumbert676
      @majorhumbert676 2 года назад +5

      @@andreicojea The main problem is that this promise creates a side-effect when the module is executed. Modules should be free of side-effects for various reasons. The fetch request will execute even if the component is not rendered, as long as the module is imported somewhere. Think about how confusing it will be if you render the this component in different parts of the application. You're also preventing tree-shaking from taking place.

    • @andreicojea
      @andreicojea 2 года назад

      @@majorhumbert676 makes sense 🤔 I would love to see Jack Herrington releasing a follow-up video addressing these issues

  • @useeffect
    @useeffect 2 года назад +1

    4:50 ehh... I thought I would finally find out where I can shake your hand for all these React learning materials :D

  • @grayson1536
    @grayson1536 2 года назад +3

    I love watching your videos at night, they help me sleep! Do you think for Halloween you could be Goku? You seem like a big fan!

  • @EthanStandel
    @EthanStandel 2 года назад +2

    Yooooo this is legit exactly what I said in my comment on the RFC! "Seems like it could be at risk of becoming the next big foot-gun."

    • @EthanStandel
      @EthanStandel 2 года назад

      For the record, I love this take overall: this thing is really cool and opens up new possibilities, but it also creates high risk of these problems.

  • @thatryanp
    @thatryanp 2 года назад +1

    Thanks for the good content!
    It's worth calling out that React will never see updates to the data cache because it lives outside the React tree.
    I'm looking forward to trying out Preact signals, just rediscovered Preact after watching your vid on Fresh.

  • @MrMewMew
    @MrMewMew 2 года назад +1

    I'm not a computer guy. When this video popped up in my feed I thought I was having a stroke when I read the title. I'm glad it wasn't.

  • @alanhoff89
    @alanhoff89 2 года назад +6

    Isn't that already possible? I mean currently, if we throw a Promise, Suspense will wait for that promise to fulfill then try to render the component again. Isn't that the exact same thing?

    • @OryginTech
      @OryginTech 2 года назад

      Yeah, confused why we need this. We also literally just do !isFetching to wait for data before rendering. Why do we need this? Convenient yes but why…?

  • @sreekar_s
    @sreekar_s 2 года назад

    15:42 If I'm not wrong, I'll have to refetch the data on client side. Isn't it?

  • @lourenskaufmann8382
    @lourenskaufmann8382 2 года назад +4

    I've been waiting for this one

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis 2 года назад +1

    Thanks for the succinct explanation and the excellent to the point examples Jack!

  • @SachinSomia
    @SachinSomia 2 года назад +1

    At 10:50 you type $ then I think id to correct to {id}, is that an extension?

    • @jherr
      @jherr  2 года назад +1

      No, that's my fat fingering, and then removing it during editing. :)

  • @BHFJohnny
    @BHFJohnny 2 года назад +1

    I was like "Please don't reveal your position, please don't reveal your position".
    Glad you're in "Tokyo".

  • @BaldeepSingh24
    @BaldeepSingh24 2 года назад +1

    Thank you Jack! Atleat now i can fully understand what it means and does!

  • @varunnarayanan6301
    @varunnarayanan6301 2 года назад +1

    The only video which explains use 👍

  • @thegrubyak
    @thegrubyak 2 года назад +1

    which vscode plugin counts console.log executions at 16:55?

    • @jherr
      @jherr  2 года назад +2

      That's Console Ninja, a new extension from the folks at Wallaby. This is an early preview that I got and I'm really enjoying it.

    • @eliisrael4112
      @eliisrael4112 2 года назад

      I think this extension is exciting at least as the new Use Hook 😱

  • @francoisarbour1207
    @francoisarbour1207 2 года назад +1

    Great content Jack! Keep it up.

  • @georgios_georgiou
    @georgios_georgiou 2 года назад +3

    Really interesting concept the one with "use" hook and how React has matured from the traditional way of rendering data while pending.. Also the cachedUrls approach is really appealing to me!

  • @luchopt20
    @luchopt20 2 года назад +1

    Hello @Jack what is the extension at 3.49 that show's the gray text ?

    • @jherr
      @jherr  2 года назад +1

      GitHub Copilot

  • @leoryzap
    @leoryzap 2 года назад +1

    The nope clip was great haha

  • @minhhieple6483
    @minhhieple6483 Год назад

    By the time I finished watching the video, I still didn't really understand how to use use.
    - 1: Will it be used on client side or server side or both?
    - 2: If calling the api takes 10 seconds, during those 10 seconds the website will be blank (no content)? That means it will block the html rendering stream?
    - 3: How to handle errors and loading status?

  • @paneurhythmie
    @paneurhythmie Год назад +1

    Hi Jack, thank you for the great content about react and nextjs. I tried to code along with you, and receice the following error: Uncaught TypeError: use is not a function. What I'm doing wrong?

    • @jherr
      @jherr  Год назад

      You have the wrong version of react and react-dom. As I recall I was working off a beta version at this time, but the current version of React 18 should have it.

    • @paneurhythmie
      @paneurhythmie Год назад

      ​@@jherr Thank you for your answer. I'm using "react": "^18.2.0", "react-dom": "^18.2.0". In the beta react documentation I could't see a use() hook. Are you sure, that this hook is alrady part of react 18?

    • @jherr
      @jherr  Год назад +1

      @@paneurhythmie Whatever NextJS 13 is pulling for React it's in there since NextsJS 13 in the app directory supports `use`.

  • @jamesfoley4426
    @jamesfoley4426 2 года назад +1

    Jack what stops the set Initialize state update in the use effect hook from running before promise.all completes?

    • @jherr
      @jherr  2 года назад

      The await. And if the await isn't there then the await that should be there. 🤣

    • @jamesfoley4426
      @jamesfoley4426 2 года назад

      @@jherr Why does it not jump over the await and execute the state change then come back to the await. Is it because the outer function is await?
      I really enjoy your stuff and the podcast. I think you should concentrate just on bringing along intermediate developers there is so much junior developer trainers out there repeating the same thing. I think you would be a great intermediate dev instructor. I think the intermediate dev is underserved. We all keep learning and I think you can use less code and diagram out more theory and concepts. Just a thought. Look forward to the NEXT.js update after tomorrow.
      cheers Jim

  • @patite3103
    @patite3103 2 года назад +1

    I like your videos! Would it be possible to do a series of videos on Next.js 13? Doing some projects with Next.js 13. Thank you

  • @farzadmf
    @farzadmf 2 года назад +3

    Thank you for the informative video.
    Quick (and maybe unrelated) question: is it possible to use `useMemo` instead of implementing our own cache?

    • @jherr
      @jherr  2 года назад +2

      I've tried and it doesn't work for me. Conceptually I think it should work. Could be an issue on the experimental branch.

  • @JorMorera
    @JorMorera 2 года назад +1

    I'm too new to understand how it works, I'll save the video and watch it later

  • @hamzahmd_
    @hamzahmd_ 2 года назад

    Great analysis and implementation!

  • @bb0jan
    @bb0jan 2 года назад +1

    nice video, while on the topic of prefetching maybe video for Qwik js

  • @SeanCassiere
    @SeanCassiere 2 года назад +1

    God forbid anyone plans a drinking game around the number of times the word "use" was said.

  • @jaroslavhuss7813
    @jaroslavhuss7813 2 года назад +1

    Hoy Jack, would you mind to share the tooling behind your YT videos? What workflow and editors are u using so you have a perfect sync between screen recording and face recording? Thank you!

    • @jherr
      @jherr  2 года назад

      I definitely need to do that. But the secret is that I synchronize on a clap like in the movies. Not that that's a secret. :) I use an Atomos Ninja V to capture my video. I use Screenflow to capture the screen and real audio. I use Izotope to fix the audio. I use Premiere to sync the audio with the green screen video. And then I import the greenscreen into Screenflow, edit, output both the recording and the green screen independently, then I stitch it all together in After Effects. Though I'm moving that flow to Premiere, and will use After Effect to manage scene by scene. (Most videos are three scenes; intro, code, outro.)

    • @jaroslavhuss7813
      @jaroslavhuss7813 2 года назад +1

      @@jherr Thank you ! And I forgot to mention - you sir, you are the absolute/ultimate source for React.js - finally somebody who covers advanced concepts of this FW - keep it going please. Thank you for your work and for the whole community I can say - your teaching skills are beyond expected! Thank you and sending many greetings from Prague, The Czech Republic

    • @jherr
      @jherr  2 года назад +1

      @@jaroslavhuss7813 Thanks! I really appreciate that!

  • @andersonandrade756
    @andersonandrade756 2 года назад +1

    Very helpful..thanks a lot.

  • @francis_n
    @francis_n 2 года назад

    at 19:12 how come you don't need to await init() ?

    • @jherr
      @jherr  2 года назад

      You can't actually await init() because that would require making the function an `async` function which would return a promise and `useEffect` won't work with functions that return a promise.
      The reason that I define a function within the function that I send to useEffect is so that I can make it async and use await within the interior function.

    • @francis_n
      @francis_n 2 года назад

      @@jherr ahh ok thanks. For some reason I thought it a function was declared as async, it HAD to be awaited.

    • @jherr
      @jherr  2 года назад

      @@francis_n I can understand that, but no, you don't need to await an async function.

    • @francis_n
      @francis_n 2 года назад

      @@jherr Thanks, somehow I forgot that detail 👍🏾

  • @rafaelmian1057
    @rafaelmian1057 2 года назад +2

    Hey, could someone explain the meaning of footgun? Thanks

    • @eliisrael4112
      @eliisrael4112 2 года назад +2

      Any feature whose addition to a product results in the user shooting themselves in the foot.

  • @SuperXoChe
    @SuperXoChe 2 года назад

    Awesome video! What extension are you using for the inline console.log info at 17:00?

    • @jherr
      @jherr  2 года назад +1

      That's the new Console Ninja extension from Wallaby. They gave me a preview copy and it's amazing. Should be released soon.

  • @Staslyu1997
    @Staslyu1997 Год назад

    what is this tool what make highlights on browser?

  • @nightire
    @nightire 2 года назад +1

    Hi Jack, why do you switch back to iTerm again? Is warp not good enough for you?

    • @jherr
      @jherr  2 года назад

      Fig has gotten to the point where I can't live without it.

  • @nekonovi5038
    @nekonovi5038 2 года назад +1

    What plugin do you use to have those predictions while you are writing the code? Btw great video 😁

    • @jherr
      @jherr  2 года назад +2

      GitHub Copilot.

  • @danvilela
    @danvilela 2 года назад +2

    Awesome video! But what extension do you use to show console.log on vs code directly? Looks cool!

    • @jherr
      @jherr  2 года назад +6

      That’s Console Ninja from the wallaby guys. I got a preview copy and I’m really digging it!

    • @code1860
      @code1860 2 года назад

      @@jherr Can't wait to try it myself. Please see if you can make a review on it.

  • @linkinparkkiro
    @linkinparkkiro 2 года назад

    How do you handle the error state for that Promise with this "use" hook?

    • @jherr
      @jherr  2 года назад +1

      I think you would need to catch it and then resolve it with the error encoded in the data and then check for the error in the component.

  • @ayushtripathi4514
    @ayushtripathi4514 2 года назад +1

    what are your thoughts about useEvent hook?

    • @jherr
      @jherr  2 года назад

      I thought it was a good idea.

    • @ayushtripathi4514
      @ayushtripathi4514 2 года назад

      Does it have any performance issue?

    • @jherr
      @jherr  2 года назад

      @@ayushtripathi4514 Don't think we would know until we have it available.

    • @ayushtripathi4514
      @ayushtripathi4514 2 года назад

      Thanks ❤️❤️❤️❤️

  • @geebsayshi
    @geebsayshi 2 года назад

    Definitely those libraries still very useful for auto refetching, caching et al. However this opens door to loads of possibilities

  • @Thorax232
    @Thorax232 2 года назад

    Thank you for explaining this instead of just making fun of it. I get it "use use," neat joke. But what's it for? This is actually very useful and it's a nice insight on how Server Components are coming along. It's very promising.

  • @alessandropicchi2692
    @alessandropicchi2692 2 года назад

    I am currently using redux to handle app state, api data, error and loading state. Do i actually need this? What is the advantage? Maybe starting a new project using async components will be faster and cleaner? Thank you if someone will answer my questions

    • @jherr
      @jherr  2 года назад

      No, you don't _need_ this.

  • @hyposlasher
    @hyposlasher 2 года назад +1

    What does first class support mean?

    • @jherr
      @jherr  2 года назад

      Support specifically designed for promises in the framework.

  • @stefan9599
    @stefan9599 2 года назад

    Great Video as usual!

  • @avi7278
    @avi7278 2 года назад

    Hey Jack, how do you get the inline virtual text for console log's?

    • @jherr
      @jherr  2 года назад

      That's console-ninja from the Wallaby folks. It's great!

  • @quelchx
    @quelchx 2 года назад

    Im so pumped for this new feature (hook or whatever people want to call this)

  • @komodoutd
    @komodoutd 2 года назад

    Hey sir, what is the name of that vs code plugin which autocompletes (predicts) the code before you are about to type it?

    • @jherr
      @jherr  2 года назад +1

      GitHub Copilot. Although it was pretty off base on some of its recommendations this time.

  • @mdmathewdc
    @mdmathewdc 2 года назад +1

    Question: Why can't they name it as 'useAwait' instead of 'use'?
    Excerpt from the RFC:
    You can think of use as a React-only version of await. Just as await can only be used inside async functions, use can only be used inside React components and Hooks.

    • @jherr
      @jherr  2 года назад

      It is a request for comment, so feel free to comment. :)

  • @kasvith
    @kasvith 2 года назад

    @Jack, would you be able to do some Vite Plugin content? writing some cool vite plugin to understand how bundlers work? this would be great

  • @jirikrajnak9047
    @jirikrajnak9047 2 года назад

    0:00 YES!

  • @RodrigoMallmann1
    @RodrigoMallmann1 2 года назад

    Would love an exemple of caching like this in a more professional cenario. Sometimes we can make do with just react

  • @Zenexis
    @Zenexis 2 года назад

    Does use hook take a functional variation? Something like const bla = use(() => fetch('/bla')......) This way? This should resolve that issue without additional function declaration.

    • @jherr
      @jherr  2 года назад +1

      Not as far as I know. But would it help though? Because you'd be creating a new function reference with each render. You could use it in combination with a `useCallback` to stabilize the function reference.

    • @Zenexis
      @Zenexis 2 года назад

      @@jherr I assumed it would work the same way as the function variation of useState hook which only runs once. So if this worked the same way, it'd make it little compact.

    • @Zenexis
      @Zenexis 2 года назад

      Like useState(() => console.log('yo')) only prints 'yo' once no matter how many time the component rerenders, I assumed this would work the same way.

    • @jherr
      @jherr  2 года назад +1

      @@Zenexis I get yah. But it's not quite the same thing as useState since it's just a listener on a mutable source that it doesn't control.

  • @william3588
    @william3588 2 года назад

    the start of a new react era? 😛

  • @risechess7114
    @risechess7114 Год назад +1

    its telling me use is not a function ??!!! any recommendation

    • @jherr
      @jherr  Год назад

      Check the React version.

    • @risechess7114
      @risechess7114 Год назад

      @@jherr },
      "dependencies": {
      "react": "experimental",
      "react-dom": "experimental"
      },

    • @jherr
      @jherr  Год назад +1

      @@risechess7114 I don't think that's required anymore. It should be there in 18.2 which I think is what NextJS 13 depends on.

    • @risechess7114
      @risechess7114 Год назад

      @@jherr so your suggesting i change the depancancies to 18.2 and npm install and try it ...

    • @jherr
      @jherr  Год назад +2

      @@risechess7114 I don't have the bandwidth to walk you step by step through this. There is a Discord server associated with the channel if you want support from the community discord.gg/tZweCBc4 . Please read and follow the #rules before posting, in particular do no @ me directly. But I strongly recommend instead of doing that, take the time to drive this yourself, it will teach you a lot about debugging through issues like these.

  • @webblocksapp
    @webblocksapp 2 года назад +2

    I'm quite worried about the arrival of this new use hook on React: use is a pretty broad name to begin with. Is it going to be in charge of managing any asynchronous process, why not useAsync better? or Why not useFetch, useRequest or a more specific name if it is only for processing requests? . What will happen to current design patterns that use state handlers? The React team keeps changing the rules of the game, instead of focusing on improving / changing its render engine to finish that mental model of re-renders, that's why more hooks keep appearing instead of giving a definitive solution to the issue of re-rendering.
    What are your thoughts? I leave open the thread.

  • @jon1867
    @jon1867 2 года назад +1

    I like `useAwait` since that's exactly what you're replacing

    • @ebrelus7687
      @ebrelus7687 2 года назад

      But there are differences right? 🤔

    • @jherr
      @jherr  2 года назад

      Await "blocks" until it's ready. Where this is going to return null until it's resolved and then it's going to return the data from the promise.

  • @davidwu1907
    @davidwu1907 2 года назад

    Is it still an experimental feature?

    • @jherr
      @jherr  2 года назад +1

      Apparently not. It’s been promoted to just “use”

  • @ShanyGolan
    @ShanyGolan 2 года назад

    One day, Jack will find out about NeoVim, and will never go back... :D

  • @Gaijin101
    @Gaijin101 2 года назад

    So.. its Nuxt?

  • @yadusolparterre
    @yadusolparterre 2 года назад

    I really struggle to see which problem this solves. It just makes your code dirty by using async callbacks.

  • @guygolan3685
    @guygolan3685 2 года назад

    dumb question. what does RFC stands for?

    • @jherr
      @jherr  2 года назад +1

      Request For Comment

  • @PhilippeElsass
    @PhilippeElsass 2 года назад +1

    It seems it's not correct to say that when using `use` it does one render without the data then another render with the data. You only get one log after `use` which seem to indicate the function is interrupted, as with a `throw`, then it re-tries rendering when the promise has completed.
    Not gonna lie, I don't like the promise caching shenanigans for now.

    • @shadamethyst1258
      @shadamethyst1258 2 года назад

      That's something that's mentionned in the RFC: `use` will actually throw until the promise is resolved. So this means that you can really only have one use per function, and components called in them will not be called until the parent `use`s are fulfilled.
      I personally don't like this feature. React is trying to stay away from compiling javascript code, but it is now employing tricks like `throw` to manipulate the code path at the cost of performance

    • @PhilippeElsass
      @PhilippeElsass 2 года назад

      ​@@shadamethyst1258 I think you can have multiple `use`, but they will run as a waterfall.

  • @georgekalogeropoulos1813
    @georgekalogeropoulos1813 2 года назад

    font ?

    • @jherr
      @jherr  2 года назад +2

      JETBrains Mono

  • @AlexCrr
    @AlexCrr 2 года назад

    I'm a simple man. I see a Jack Herrington video, I like it first, and then I watch it!

    • @jherr
      @jherr  2 года назад +1

      Thank you!

    • @AlexCrr
      @AlexCrr 2 года назад

      @@jherr , Thank YOU for the valuable info in every video! Keep 'em coming

  • @NosherwanGhazanfar
    @NosherwanGhazanfar 2 года назад

    The new framework QWIK seems to have gotten around the whole hydration issue & calls itself a resumable framework. What are your thoughts on QWIK Jack?

    • @jherr
      @jherr  2 года назад +1

      I've had some issues with it. I keep hearing great things. Trying it out. Getting frustrated. Dropping it. And then hearing great things again. About the furthest I've gotten with it is putting it into a benchmark against Deno/Fresh, Bun/NextJS, Node/NextJS, etc. and it ran about as fast as Fresh, which is good.

    • @jherr
      @jherr  2 года назад +2

      @@NosherwanGhazanfar Solid Start is more interesting to me just because the familiarity level with Solid is great.

    • @jherr
      @jherr  2 года назад +1

      @@NosherwanGhazanfar I will say that I'm getting requests about Qwik on every video nowadays, so maybe I just need to do it. :)

    • @NosherwanGhazanfar
      @NosherwanGhazanfar 2 года назад

      @@jherr that would be a great help 🙏🏽
      i am also trying to find time to learn more about it

    • @theextreme1927
      @theextreme1927 2 года назад

      Don't waste your time on such a frameworks, just use react-based framework, like Remix for the ultimate DX.

  • @tshawtshi3040
    @tshawtshi3040 2 года назад +1

    Feature creep imho. Now they are trying to do everything

    • @fgascon1
      @fgascon1 2 года назад

      It's actually something that is not possible to do in user land. The RFC for the new `use` is for something very minimal to unwrap promises which user land libraries will be able to leverage to make awesome things.

  • @go371211
    @go371211 2 года назад +2

    React is a foot gun

    • @jherr
      @jherr  2 года назад

      I don't disagree.

  • @greendsnow
    @greendsnow 2 года назад +1

    I see another half baked useEffect over there.

  • @kasvith
    @kasvith 2 года назад +1

    Gladly frameworks like Vue/Svelte allow you to have async components without weird `use` syntax...just using plain javascript with async/await.

    • @majorhumbert676
      @majorhumbert676 2 года назад

      _use_ is just a function call; it's not syntax. And Vue and Svelte are the languages/frameworks with special syntax, not React.

  • @oumardicko5593
    @oumardicko5593 2 года назад +1

    not gonna lie all these new hooks are too much when people are still struggling with the old ones (useEffect). My advice to people, write all your business logic in something like rxjs, use react to only display things or react to certain events

    • @OryginTech
      @OryginTech 2 года назад

      I don’t understand why useEffect confuses people so much. It literally could not get any simpler. I hear this all the time and it makes zero sense.

  • @cocoscacao6102
    @cocoscacao6102 2 года назад

    Still using Angular in the same way like I did 3 years ago, where none of this shit exists...

  • @itzhaktzadok
    @itzhaktzadok 2 года назад

    useAsync

  • @LarsRyeJeppesen
    @LarsRyeJeppesen Год назад

    React just gets more and more clumsy and less and less elegant.

  • @freespeech515
    @freespeech515 2 года назад

    I want to learn REACT but this "OVER CODING" for small stuff sucks. What i expected is configurable components to build things. Instead all kinda store ...nonsense reducer patter. No micro rendering...it sucks. I have done crud api for my database in typescript in 2 days. I am waiting for dashboard in front end. I need cleaner code development. I am watching every video to seee anyone write cleaner simpler code. I will avoid typescript nonsense for Front end. Its pure stupidity. Most of the bugs can be caught with visual code. Sure few can get in but that is minimal. There is no need for static typing if visual code can catch them as you type.
    May be i hate typescript syntax. It can work if its java syntax. There is no readability with typescript. Its ok in server coding though.
    All types has to be in Types directory in separate file. everyone doing typescript coding for the sake of typescript. its forced coding.
    I want to reuse components. Not this react nonsense way. some incompetent people created react and poured money.
    I did x-datagrid with nextjs13 . it works. its only 30 line code. You write billion line code if you did what i did. Also no double calls to server or rendering.
    localhost:3000/api/person/1 same code work for order or any damn table. complex queries goes via localhost:3000/qapi/getsomething ( database view ) and queries on them.
    I did prisma then did pure sql
    Only reason i am watching react is mui x-datagrid does what i need and also learning react for the sake of future job but i am in research mode to find what is my best option for front end. want same for mobile app development.

  • @adamsmith3149
    @adamsmith3149 2 года назад

    this caching outside the rendering is horrible

  • @jcoucelanga4373
    @jcoucelanga4373 2 года назад

    i wasnt tired about useEffect but hey use() seems like an improvement tbh