Can you use Next.js with a React Native App?

Viewed 1050

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!

1 Answers

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. While , when you get build version of your Next js project , you are going to receive HTML , Css , Js and this 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.

Related