ryanflorence
We already have experimental versions of Remix running on React 18 and have experimented with RSC, Suspense, and streaming extensively. In their current state however, we're not seeing them beat Remix's current approach in production results or developer ergonomics. We've been providing the React team with our feedback. When these features from React are ready, Remix will be able to easily support them.
Remix doesn't ship an infinite scroll/pagination set of components so it's up to apps to make sure that state is still there when the user clicks back. If the state is still there, Remix's scroll restoration will work.
You could either manage your own global state for this, but I like to use "location state" which is our API into the browser's built in `history.state`.
There are various ways to use it (declaratively, imperatively, etc.), but simplest way to explain is to imagine a "Load more" button that's really just a link like this:
`<Link to="?page=2" state={{ data }} />`
Your Remix loader would load page 2 from the url search param and your component would concat that onto `location.state.data` (the previous entries from the initial location). This renders the old data and the new data together.
Location state, unlike typical "global state", automatically persists across both refreshes and back/forward button clicks, but dies with the session, so scroll restoration will work as expected even for a refresh! Built in browser APIs tend to be a bit more resilient than storing stuff in application memory, they also keep your bundle smaller.
I don't know where the demo is, but I helped somebody at some point implement this without needing to ship a global state container for server-supplied data. Just made a note to make an example and put it our repo :)
If we're talking "load more" a much simpler way to do it is to consider how you'd do it old school with no JS. Just return all pages according to the search param, so "?page=3" would return all three pages. More kB over the network, but far easier to implement. There's even a product reason to do it this way: when you load more you automatically update the comment counts/points of each entry, so maybe it's worth it.
Great question!
One more time for those in the back:
v0.x > v1 Breaking changes
v1 > v2 > v3 a couple obscure breaking changes, but practically none
18 months pass
v3 > v4 New, composable design, basically a new project
v3 still maintained, 3.5 years no changes. v4 2 years, no changes.
v4 -> v5 was supposed to be 4.4, but an internal dependency '^' got us, so best choice was version bump to prevent problems.
Workshop.me, Training on Vue, React, Webpack and More from OSS Maintainers
No? Huh.
React Training's Advanced React.js Patterns Videos Now Free
Free Updated React (v15.5) Course by the Creators of React Router
Our workshops have $899 early bird tickets.
Every software company I've ever worked for sells training and consulting for their software.
That was 2 years with only one breaking change.
2.0 -> 3.0 removed deprecated 1.0 API, fully BC with 2.0
The only churn is for people who don't stick to stable releases, and that's their own problem.
2) In React Router you can have a statically available route config. This is React. Make an array then map it to render.
3) React Router is all components, so it composes exactly like the rest of your app. No new API to learn. It's Just React™
We had breaking changes from 0.13 to 1.0.
Then complete BC from 1.0 to 2.0
That's two years, one breaking upgrade.
Don't confuse a libs "changing API" with "people use the development branch as stable".
2. Have a ton of examples in the repository
3. Use it in production in your own stuff
4. Keep a solid change log and upgrade guide
5. Ignore the stars, all of this is for your team.
https://github.com/rackt/react-router/blob/master/docs/guide...
We're almost done with serializing the application data as well. Both pieces are important.
Every application has UI nesting at the core of its state, though.
The point of JSX is to express attributes and hierarchy, which matches with our route configs perfectly.
How do you feel about <script/> tags, or <link/> or <meta/> or <base/>?