I use React sure, but I don't feel particularly defensive about criticisms of it when they actually make sense. But blaming a 400KB bundle on the fact that the user used React is a bit absurd to me and makes it really hard to take anything Alex says seriously on that front.
-
-
Sure. Basically any leaf can suspend rendering. Including due to code splitting. But we don’t show the spinner necessarily where it suspended. Instead we let you specify <Placeholder> *somewhere* above. Making your loading states intentional, not an artifact of bundle split.
-
So you can have <Placeholder fallback={<Spinner />}> <Modal /> </Placeholder> And then somewhere deep in the Modal there is Autocomplete. If it’s code split, React can show spinner in Modal backdrop — or even next to Button that caused Modal to show.
-
This means that you can code split more at any point in time — for example to load ModalHeader — without worrying about changing design. You already have a Placeholder. It will wait for both ModalHeader and Autocomplete as it tries to render Modal.
-
As a bonus, in concurrent mode we can skip showing the spinner altogether if it loads fast enough. We don’t show holes either. We just show the complete Modal if it’s ready fast enough. That’s what Fiber architecture allows.
-
The modal example is fun because it means you’re not constrained by DOM hierarchy. If modal is a portal from some form, loading state for thay modal can be handled that form. Even though technically it’s top level body child in the DOM.
-
Yeah this all makes sense. Thanks for the explanation
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.


