Dan's currently updating the docs. Reminder this is the advanced part , useEffect is very powerful. Again don't look at this document as a need to, but rather to inform you because it's lengthy. Ton's of people wanted these things added to the docs:
Okay what I understand is that React 18 is making me change where I fire async network calls, because I do not want those firing twice. Oh, and its not immediately clear how this common use case is handled. great.
This is classic React, the most common features are either missing cause its a LiBrArY or tedious af to use, then hundreds of 3rd party solutions comes out, the community asks core team for a standard implementation but gets gaslighted for years cause "they are using React in the wrong way", then the feature is finally added, but it is tedious to use and doesn't cover all use cases, rinse and repeat.
What is one clear benefit that you see for using the new useSyncExternalStore? What specifically does this hook give you that the state plus use effect hooks didn't in the pre react 18 era?
Can you point to any other videos that describe the issues with useeffect that you were trying to get across? I'm not sure I "got it" from the talk you gave.
Welp... this just scares me into switching to a different framework. SolidJS/Svelte just started to make more sense. Why is it so difficult to run something on component mount?
Because the React team treats the browser as a compile target and nothing more. The motto for React was "write once, run anywhere" for a while after native came out. In that world, React is the VM scheduling everything and "component mount" doesn't fit in their philosophy where everything is unstable and can happen at any time, however many times.
Not only does this happen, I regularly see code similar to this, and the effect isnt even a side effect ;D one state update triggers another one and that triggers another one in different useEffects...
Why ecosystem of Javascript and its libraries doesn't get stable. Rather than creating something most of the time got spent in learning new tools and methodologies.
Yup, I love Xstate (and state machines in general), but it's very much a tool for a specific type of job. I'm fighting this battle at work right now, where some people want to jump into xstate with both feet without stopping to ask "What problems do we have, what problems does this solve, and what will we use to fill in the gap between them?" That mindset is how we found ourselves mired in the rxjs/redux-observable/epics combo, and have only just recently gotten out of that with the new features of RTK (query and listener middleware). Shoutout to
I'm a little confused because I've been using useEffect to pull data. Where do they want this to happen now? You go to a new page of an app, rather than fetching the data at the component level, you're supposed to fetch it at the router level? Without using other libraries just using React, React Router(optional), useReducer, and useContext, when/where are we fetching the data?
My interpretation is that you wrap the usage of useSyncExternalStore by your own useMyStore and you’ve got yourself a library. Before this, people were using
Much of this presentation makes me uncomfortable.
TLDW? In general it's good to summarise longer videos.
State machines good. I think that's a TLDW for every David's talk (unless it's about animations) :-)
Some quick takeaway points:
[удалено]
The talk is about XState.
Or, ya know, fucking write documentation.
More confusion, more quirks, still no documentation, this bs pisses me off.
Dan's currently updating the docs. Reminder this is the advanced part , useEffect is very powerful. Again don't look at this document as a need to, but rather to inform you because it's lengthy. Ton's of people wanted these things added to the docs:
Okay what I understand is that React 18 is making me change where I fire async network calls, because I do not want those firing twice. Oh, and its not immediately clear how this common use case is handled. great.
This is classic React, the most common features are either missing cause its a LiBrArY or tedious af to use, then hundreds of 3rd party solutions comes out, the community asks core team for a standard implementation but gets gaslighted for years cause "they are using React in the wrong way", then the feature is finally added, but it is tedious to use and doesn't cover all use cases, rinse and repeat.
The point is you were never supposed to do that but yeah...
Person in the video here, thanks for sharing!
[удалено]
What is one clear benefit that you see for using the new useSyncExternalStore? What specifically does this hook give you that the state plus use effect hooks didn't in the pre react 18 era?
Can you point to any other videos that describe the issues with useeffect that you were trying to get across? I'm not sure I "got it" from the talk you gave.
React the library which creates problems for other libraries to solve.
Welp... this just scares me into switching to a different framework. SolidJS/Svelte just started to make more sense. Why is it so difficult to run something on component mount?
Can anyone explain how to run something on component mount given this new info?
Because React team never listens to their users. Or listens and ignores, which is worse.
Right? That should be one of the easiest tasks.
Vue is pretty trivial on this too.
Yeah, it was so easy pre-React 18, like, there was no thinking about it, just useEffect with empty deps and that's it.
Because the React team treats the browser as a compile target and nothing more. The motto for React was "write once, run anywhere" for a while after native came out. In that world, React is the VM scheduling everything and "component mount" doesn't fit in their philosophy where everything is unstable and can happen at any time, however many times.
I'm baffled that people would ever
On an unrelated note, what kind of hell typeface is that in the screenshot where you can’t differentiate parentheses and square brackets at a glance 😑
Not only does this happen, I regularly see code similar to this, and the effect isnt even a side effect ;D one state update triggers another one and that triggers another one in different useEffects...
React honestly makes angular look very appealing these days
React honestly
What can I say, front end development is really tiresome and tiring.
Tiresome AND tiring? Wow
Why ecosystem of Javascript and its libraries doesn't get stable. Rather than creating something most of the time got spent in learning new tools and methodologies.
You're always going to be learning new tools. Don't expect that to change. If you aren't than you aren't going anymore.
For the people that can't make an opinion out of this talk,
Yup, I love Xstate (and state machines in general), but it's very much a tool for a specific type of job. I'm fighting this battle at work right now, where some people want to jump into xstate with both feet without stopping to ask "What problems do we have, what problems does this solve, and what will we use to fill in the gap between them?" That mindset is how we found ourselves mired in the rxjs/redux-observable/epics combo, and have only just recently gotten out of that with the new features of RTK (query and listener middleware). Shoutout to
I'm a little confused because I've been using useEffect to pull data. Where do they want this to happen now? You go to a new page of an app, rather than fetching the data at the component level, you're supposed to fetch it at the router level? Without using other libraries just using React, React Router(optional), useReducer, and useContext, when/where are we fetching the data?
Use suspense...
More like goodbye React
My interpretation is that you wrap the usage of useSyncExternalStore by your own useMyStore and you’ve got yourself a library. Before this, people were using
I hate useEffect so much.
Xstate is boss
People use useEffect to pull data o.O? I only use it to react to the data that was retrieved from the backend lol
greate , when to get the document,and example for best practice .