I really appreciated this careful, nuanced take on SPA vs server-side #React, and the implications to routing and data fetching in #ReactRouter v6: https://programmingarehard.com/2023/04/01/react-routers-data-utilities-are-awkward.html/
React Router used to be so good, now it's seriously junk. I don't want your dumb <Outlet /> and providers with static paths, I want nested component paths so I can shove contexts easily. Why are you making this so hard? And by the time I find how to do it, now I can't use `useMatches` because I do not conform to their dogma. What a load of s***
As promised, new blog post on how to serve Single Page Apps (SPAs) through CloudFront.
https://dev.to/santisbon/serving-a-react-router-app-through-cloudfront-1h28
#WebDev #react #reactrouter #aws #cloudfront
The more comfortable I am with React the better I am at picking up libraries, build tools and frameworks that go hand in hand with React development today.
It's exciting to graduate as lots of innovation happens in this space, especially in the last 6-12 months. I'm finding Next.js super cool to play around with as well.
As far as build tools go, how great is Vite?! 🔥😎⏩ https://vitejs.dev/ a must to check out if you just wanna play!
#vite #nextjs #reactrouter #remix
TIL that in React Router v6 the Prompt component has been removed. So we now have to code the mechanism ourselves or find a third-party library.
Mmmm... in the following days I could try to code a custom Prompt component as a practice project and see what happens.
I could easily take these and wrap #reactrouter’s components and hooks to give a well typed API. Part of this would include generating that same path string at runtime so it can be plugged into a Route component.
But, if I wrote my own router, I could instead define a more sophisticated combinator DSL for parsing and extracting data from the path.
This is overkill, I know. Please, someone, stop me.
Stumbled across the fetcher/action data APIs in React Router 6.4. These folks tend to know what they’re talking about so I give them the benefit of the doubt.
But I’m skeptical of the data library integration pattern… it seems like you make the same requests in the loader function and again in your component via the hook (getting cached values).
That means that the loader and the hook use need to be kept in sync…
#javascript #react #reactrouter #reactquery