Start Here
Stories
Ideas
Start Here
Learn what it means to be an indie hacker.
Community
Connect with other founders and creators.
Stories
Get inspired by others' success.
Ideas
Get your creative juices flowing.
Products
See what everyone's working on.
Store
Buy an Indie Hackers t-shirt.
Newsletter
Stay up-to-date in 5 minutes or less.
Log In
Sign Up
3
Likes
0
Bookmarks
7
Comments
Report
A library for simple full-stack data loading in React
by
David Nicholas Williams
David Nicholas Williams
davnicwil.com
Trending on Indie Hackers
I've built a 2300$ a month SaaS out of a simple problem.
19 comments
🔥 Roast My Landing Page
12 comments
Where can I buy newsletter ad promos?
8 comments
Key takeaways growing MRR from $6.5k to $20k for my design studio
6 comments
How would you monetize my project colorsandfonts?
5 comments
YouTube? How to start
5 comments
Hi guys, I just shipped v2 of my library React Frontload - it basically gives you a batteries-included solution for loading data inline into React components using a hook that just works on both the client and server (with a bit of one-time setup of course)
The 'loading data with a hook' thing is done by a few other libs. What I haven't seen other libs do is actually take care of the async server render, and client data hydration & sync parts, which react doesn't offer and something has to polyfill.
Other libs tend to assume you're using something like NextJS to provide these features. With React Frontload they come out of the box, it's a truly dependency free solution that works with any React stack.
E.g. if you have an existing React app without server rendering, want to add it but don't want to plumb in a load of complex data loading stuff manually OR port your app to a framework, React Frontload could be worth a look.
Cheers, and let me know what you think!
Hi David, do you know, offhand, if I could use this with MeteorJS and React? Meteor has both server and client portions, but I wonder if for what you have here, I could possibly use yours for hydration at times. Interesting prospect.
Hi Fraser, yes you definitely can! One of the design goals of the library is to be able to slot into any React stack, so it should work with basically anything.
This is an interesting usecase - I think typically people are using react-frontload instead of a framework, but I can definitely see how it could be useful on top of one for specific purposes.
I'd be interested to hear how well this works for you, if you try it out!
Then I will give it a try! Thank for the feedback, David
This is super cool! Do you have an example of how it would work with Next.js or is this mainly for non-Next.js users?
Hi Gabe. Very late reply here, sorry, somehow missed your comment at the time I posted!
I think, in general, if you're already all in on a framework like Next it might make sense to just use its built-in server rendering features. React-frontload is really intended as a small library that provides that feature, if your framework doesn't have it or if you're not using a framework.
Gotcha, makes sense, thanks :)