-2

I've already developed and deployed ReactJS app with separated front and backend (Laravel).

I'm facing issue with sharing pages with dynamic data due to the disability of react to dynamically generating meta tags, No dynamic preview , no dynamic title .

After searching the web for days the only stable solution found is migrating to NextJs.

my question is can i migrate ( partially ) to Nextjs ?

using Nextjs router for only the sharable pages and preserve the react router for the rest pages? or any other solution other than nextjs for that issue ?

2 Answers2

0

nextjs offer ssr and csr same time. my suggestion is that you create a nextjs project and create all your routing as folder in page file. and copy your routed component in these folderand create a folder named "components" and copy your child component inside them. some difficulty may occur for localstorage or parameters etc ... after that you run your app without error you can see all your pages as csr rendering. so for seo sake!! you need to go to those page that need to be seo freindly and change them to ssr.

  • 1
    why partially ? = it's huge application and migrating the whole project will take time more than the duration needed for (Social sharing Task ) to be completed , as temporary solution. – Muhamed Gomaa Oct 25 '22 at 05:03
  • maybe you can use microfrontend and convert part of your code to nextjs partially. take a look at this link . it should be helpfull https://dev.to/logrocket/micro-frontend-with-react-and-nextjs-n6h – mohammad mohammadi nodhe May 15 '23 at 04:40
0

I'm not sure why you want to migrate partially because I think NextJS offers exactly what you want.

  1. It can generate meta tags dynamically (see next/head)
  2. Using Vercel OG, you can even have dynamic OG images (dynamic preview)

But to answer your question, no you cannot partially migrate to NextJS because it's not just a library. it's a framework.

Samy Rahmani
  • 320
  • 1
  • 7