This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-15
Channels
- # announcements (9)
- # babashka (1)
- # beginners (1)
- # calva (7)
- # cider (13)
- # clj-kondo (2)
- # cljsrn (1)
- # clojure (40)
- # clojure-europe (2)
- # clojure-spec (9)
- # clojure-uk (1)
- # cursive (4)
- # datomic (2)
- # etaoin (1)
- # fulcro (4)
- # honeysql (3)
- # lsp (43)
- # malli (7)
- # music (1)
- # nbb (6)
- # off-topic (5)
- # polylith (8)
- # protojure (1)
- # re-frame (6)
- # react (17)
- # reagent (63)
- # releases (1)
- # shadow-cljs (8)
- # testing (8)
- # tools-deps (1)
- # vim (8)
Googled it because I haven't heard of that before, landed on https://www.amitmerchant.com/the-new-starttransition-api-react-18/. Is it just me or do lots of react people have colourful websites?
Does useTransition play with suspense? The isPending seems like a separate api for is "is loading?"
based on my experience with it so far, isPending
gets set immediately on a render wrapped with startTransition
, even if it's not being blocked in any way
which is different from suspense, which will pause rendering the tree that suspended and notify the nearest suspense boundary, but only if it encounters a suspending component
they have a real world demo here: https://github.com/reactwg/react-18/discussions/65
• startTransition
signals to React that we are about to do a render that is possibly expensive and we want to opt in to time slicing to keep the app responsive
• isPending
is set immediately so that we don't have to halt the expensive rendering to render the loading state
• then we use CSS transitions or some other way of hiding the loading state until we know the render is taking awhile
I think the context to a lot of the new APIs in React 18 is that they've decided, rather than have a "Concurrent Mode" that your app either enables or disables, to have the ability to opt in to concurrent rendering for each update. startTransition
is one of the ways of doing that
Oh, no. No overlay. They're just switching from pending->done, and not showing a loading spinner.