I have recently been learning Next.js for React and I like the routing system a lot more than react navigation. Now I am about to start a react native frontend and I was wondering if you can utilise Next.js's routing system in react native as well as it's other benefits. I know that you can use it with expo but I am a little confused as to how it all works and I am starting to wonder if the Next only works on the web side of things..
Does anyone have any experience with this? Any information would be much appreciated.
Thanks!
Unfortunately you can't do such thing, due to the fact that the views of react native are Equivalent to native views in Java or Objective C. When you get build version of react native , you are receiving Java or Objective C native views thank to react native's RN bridge. Meanwhile, when you get build version of your Next.js project, you are going to receive HTML, CSS, JS and these codes are not familiar to native platforms.
However, you can use your Next.js backend as your endpoints and fetch data in react native via calling this endpoints.
UPDATE Oct_2022:
there seem to be a new tool created for this purpose , called solito. I haven't used it personally but it might meet your needs.
UPDATE Jan_2023:
It looks like there are more Tools being created for Both web and native platforms , check react-native-web
You can check out Tauri. With that you can create from Next.js, React, Svelte etc. cross-platform native Apps. Currently, Windows, Mac and Linux are supported stable. Android & iOS is currently in Alpha
The magic behind Tauri is, that they provide around your Frontend library/framework a Rust layer with that you can interact with platform native APIs. They call it Commands.
You can find the guide for Next.js here.
Also, if it's not exactly answering the question - "Is it possible to use Next.js in React native?" - I hope that it's helping everyone who is searching for a solution to use Next.js as Cross-Platform Frontend Framework
I read a thread on ycombinator on this where Solito was mentioned and tried it out. In the comments I found this, which suited my needs best :
https://github.com/mlynch/nextjs-tailwind-ionic-capacitor-starter
Solito looks nice but the all in one repo was using Expo, which I did not like because it installs an extra app. I would check it out for yourself and look at the repo above too, which is using Capacitor and is aimed at having one codebase for the two apps.
Both examples worked well. For Tauri I could not find the mobile support so I didn't try it. I would be interested to read more about people's experience with running a minimum stack for cross platform development.
Note : Solito uses React Native, the repo uses Capacitor instead, which may also suite your needs because it works on both iOS and Android.
There's a lot of support now for this tech stack. Besides solito, which is already mentioned, there is also https://tamagui.dev/ which tries to solve all the issues with react-native-web and Next.js along with Solito.
While they currently recommend a monorepo (which adds a lot of complexity in my opinion), I'm playing around with a vanilla React Native + Next.js here: https://github.com/criszz77/luna
This command should get you started to play around:
npx react-native init MyAppName --template #criszz77/luna
I have been playing with wordpress lately and I managed to deploy a simple page via a web hosting company (whc) with a domain name and everything. I love working with React and I am looking to understand how it would work in order to use WordPress with React. I played a bit with the ReactPress plugin and went through some ressources online but I am still unsuccesfull. From my understanding they are two main ways to do such a thing and I think I am mixing them up. I was wondering if there is a clear way to do so. Any info will be very welcome
There's a React framework for WordPress. You may check that.
https://frontity.org/ have a look
salam;
We developed a PWA based on react-boilerplate. it's totally based on webpack.
now I'm supposed to implement SSR on this application. the problem is that , I can't find any suitable solution on converting current project to SSR.
I tried nextjs but integration with project is not possible. additionally its requirement for changing infrastructure is too much.
I tried some other libraries such as react-snapshot and ... but each of them has some specific issues.
any body can help me?
We are thinking of remaking our more and more popular ecommerce website.
I am new to React, just went through some tutorials, read some articles on it. Learned about the use of React Native, React Render which wpuld probably be of use for eventual mobile apps and SEO improvements.
My question is if React is suited for such websites since it is mainly used to create SPAs. For ecommerce SEO is verry important, for obvious reasons, and React is not so good at this.
What would you suggest? Does anyone have experience with similar cases?
Please give us some advice on what we could use to make a complete and complex ecommerce website. What technologies/programming languages/framewors (even if other than React) should we use? Please suggest only modern technologies and libraries.
By the way, we are currently working with PHP and Yii framework.
General
At its base, React has nothing to do with SEO. It is just a way to build your web application through components (same as Vue or other frameworks).
Magento - a PHP shop system - is using React to render its frontend. You can find more on this special system in the Magento Community. See also the Documentation for Magento PWA.
Experience
What would you suggest? Does anyone have experience with similar cases?
PWA and storefronts with React/Vue/Angular are all very new. Everyone got the same problems. How to do SEO, synchronize data between storefront, APIs and the shop core system. Here's a list (to be continued).
SEO: how to work with URLs, manual URL redirects for products/cms/categories/...
SEO: Server side rendering is currently the best solution to handle googles crawler.
How to sync products, other data and especially the cart while or after beeing offline.
Extensions: How to integrate new or existing extensions which might already be installed in the conventional shop
...
Each community is trying to solve those issues. Every community learns from the other and if you choose a more or less active storefront, you should be good to go. But really keep in mind that (in my opinion) all of them are in alpha or beta state with a lot of changes you have to integrate into your own theme/extensions/etc.
Projects
Here are a few storefronts you can choose from. Most of them have an API you can adapt to support your own Shop system. I would go with a React storefront, because I found it the most readable solution and it has a huge community. But choose yourself.
Magento PWA Studio (React)
DEITY (React)
Front-Commerce (React)
Vue Storefront (Vue)
...
We are going to try build an app with react-native for the first time.
We are getting design resources from a different team and they don't have experience with react-native either.
Is there a something that we should request for react-native design resources?
Can you make native app(swift/java based) or react-native app using the same design resources?
I'm not sure this is stackoverflow-ish question, but very real question that I need answer for.
edit
I removed the question over (psd+guide vs image slices)