Starting a new Project with Refine, picking React or Next
I am starting a new project and planning on using Refine. It is a classic CRUD app with hundreds of types of datasources. I am also planning on a react-native app also.
My question is this, would you start a new project with React-Vite and monolith so that you can share data sources between the react-native and react app.
I have considered NextJS and have a version in NextJS. But I end up highly relying on client side code in the NextJS app.
So my question is this:
- If the long term goal is to have a react and expo based app, is it worth having a mono-repo with a traditional react and expo app?
I am just thinking this may seem more consistent between the expo and react apps vs an expo and nextjs app. Thoughts?
2 Replies
Hi @Jonathan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
When deciding between using React with Vite or Next.js for your Refine project, especially considering the long-term goal of integrating with a React Native (expo) app, there are several factors to consider:
React with Vite
- Consistency: Using React with Vite for your web app and React Native for your mobile app can provide a more consistent development experience. Both environments will be purely client-side, which can simplify sharing code and data sources between the two.
- Simplicity: Vite is known for its simplicity and speed, which can be beneficial for a classic CRUD app with numerous data sources.
- Monorepo Setup: A monorepo setup with React (Vite) and React Native (expo) can streamline your development process, making it easier to manage shared code and dependencies.
Next.js
- SSR and SSG: Next.js offers server-side rendering (SSR) and static site generation (SSG), which can be beneficial for performance and SEO. However, if you find yourself relying heavily on client-side code, these features might not be fully utilized.
- Flexibility: Next.js can still be a good choice if you need SSR for certain parts of your application. Refine supports SSR with Next.js, which can be useful for developing both B2B and B2C applications (source (https://refine.dev/blog/refine-vs-react-admin/#ssr---nextjs-support-1)).
Refine and React Native
- Refine Native: Refine Native can help you build cross-platform apps faster by leveraging React Native and Refine (source (https://refine.dev/blog/refine-hackathon-2/#refine-native)). This can be a significant advantage if you plan to develop both web and mobile applications.
Conclusion
Given your requirements and the long-term goal of having a React and expo-based app, a monorepo setup with React (Vite) and React Native (expo) seems like a more consistent and streamlined approach. This setup will allow you to share code and data sources more easily between your web and mobile applications, providing a unified development experience.
If you decide to go with React and Vite, you can use the
create refine-app
CLI to bootstrap your project quickly:
For more information on setting up a Refine project, you can refer to the project installation guide (https://refine.dev/blog/article-guideline/#project-installation-for-example-app).
If you need further assistance or have more specific requirements, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@697199226802929705> kapa.ai is still learning and improving, please let us know how it did by reacting below