Moving to NextJS
I'm new to Next and went through their tutorial. 3 questions -
1. I want to build a landing page for my company. Should I be using the app directory which is in beta or stick to pages?
2. My web app is currently built with create-react-app but I have been wanting to move over to the T3 stack. However, after going through the Next tutorial I am unsure how it would actually be beneficial given most of the rendering I perform in my current app is client side rendering and it looks like, to me, that it would continue to be with Next as well. Literally all that is possible for pre-rendering is titles (maybe 1 on each page) or inputs and their titles (wherever it is interactive). Maybe I'm missing something in terms of the benefits Next provides.
3. All my fetching and caching is done with react query. It has been an incredible library (especially for optimistic updates). Does the future of Next involve react query being as complementary? Just curious
7 Replies
using app directory or pages is just personal preference. since the landing page probably won't have complex routing (i'm guessing) you could try out the app directory. pages will be more stable though.
can you describe your app? are you fetching from your own backend api? the benefit of t3 is you'd be able to replace your backend service. I'm not sure if any of your application is public facing, but if so then you'd also have the benefit of SEO from next.
Makes sense!
It is a web app with tasks and workflows. I am fetching from my own backend api.
"the benefit of t3 is you'd be able to replace your backend service" I see! So next would help create the structure for server components which would go well with the idea of not needing a backend service?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
That makes sense!
Thank you
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Got it.
Any idea about how react query fits into Next 13 + RSC?
1. If it’s just a static page, the app directory is already a good choice. Also consider something like Astro which serves only html by default.
2. If you don’t care about SSR, file based routing, easy bundle splitting, SEO, etc then maybe you’re fine with the existing react app. But note that SSR doesn’t have to mean sending out static content.
What parts of the T3 stack are you considering? If you don’t want to port your backend to it, then all you can really use from it is Next and Tailwind. What is your existing backend written in?
3. Difficult to say for the time being as the Next team hasn’t released the mutations RFC yet. But my hunch is there will be a place for React Query even with server components