"initial render" is definitely not the right level here though š What does the API say about Suspense not being resolved? If anything, could be a bug.
I keep forgetting to mention immer together with redux and mobx and rx https://github.com/immerjs/immer
immer is super cool
I wish we had something like its āpatchesā feature for CLJS structures
I wasnāt going crazy: https://github.com/facebook/react/pull/18547
Good lord, talk about corner cases
WAT
thatās totally wild
thatās awful
I would open an issue with details about how confusing that was when trying to debug your app
Well, OTOH -> experimental builds and all.
hahahaha
One other thing that became obvious with Concurrent Mode, and specifically useTransition: dispatching events that trigger state changes is more nuanced. One example I was playing around with, was fetching images from Nasa picture of the day. I have a button to go the next day. Clicking the button changes the showing date and kicks off the fetch of the picture (which is inside a suspending component). I want the showing date to change immediately (responds to user input), but the suspending component stuff should use useTransition
to stay on the old value a little bit.
In the re-frame approach, Iād dispatch an event [:new-date "some date"]
which would get handled, and mutate the db
atomically which means everything would render at once.
The only approach I can thing is to only ever use local state for updating inputs, and keep the event handling atomic. Then, the caller can choose whether to dispatch the event inside a transition or not.
Of course, the whole event dispatching and processing has to be synchronous. Iām not sure how useTransition plays with useMutableSource, Iāll try that in my next experiments.
OTOH, theyāre just trying out a new reconciler, so all these experiments might end up being for nothing: https://github.com/facebook/react/pull/18889
I too struggled with useTransition the last time I tried it
I was trying to use react-router which was not behaving well with it at all
I used it just fine for a small demo
It does feel very nice - itās worth for a nice UX but boy is it annoying to work against these experimental stuff.
Is it noticeably better in some way? From a ux perspective?
Well - I havenāt made a production app with it, but I see the problem it addresses in my own app.
Do you mean useTransition or something related to suspense?
this page (and the linked videos) do a really good job of explaining the benefits to the UX: https://reactjs.org/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html
itās kind of hard to translate into a slack message š
The data fetching & loading is good, for sure
I have an exact use case - searching on the server by typing into a field. user land solutions suck and are super brittle.
Ah
This is my return to that document, I didn't remember the suggestion that data fetching should move upwards to the router/transition event. Very re-frame.
I wonder how I got over this, I also use almost exclusively console.log, I also use experimental and latest and start something new every week, so I kind even vaguely remember something related to this, but I don't really remember having any real issues. I do stuff like useEffect(() => console.log(value), [value])
I wonder if that's also disabled?
I want better REPL support for React
This is confusing me. The new reconciler is still Fiber no? Or has Fiber already become the old and there is some even new-er coming? Or are they just referring to the different modes it can be ran it in? https://reactjs.org/docs/concurrent-mode-adoption.html#feature-comparison
I want a better browser
one of these I can reasonably do myself š