-
Hi, Would it possible to use a NextJS remote in a Create React App (CRA) host app?
However when running the CRA Host, I am receiving the console error: Q: How can I resolve this issue? Is this even possible? References:
Update:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @clodal. It's a little trickier to use Next.js/Router and other nextjs packages in different abstract scenarios like in a regular CRA app, cause its libs are very coupled to the framework itself, for example, if you want to consume useRouter, you will need to share with it the RouterContext (used internally), then you will need to set up it on your shell app with it respective deps. You should work with interfaces or some EDDL/Pub-Sub tool that communicates with the router layer of your application. So you will be able to isolate and decouple the Router as a layer of your app and components that need to manipulate the router/navigation will have an interface to communicate in an abstract way without having a framework/lib a limitation |
Beta Was this translation helpful? Give feedback.
-
We are ending support for Next.js #3153 |
Beta Was this translation helpful? Give feedback.
Hello @clodal.
It's a little trickier to use Next.js/Router and other nextjs packages in different abstract scenarios like in a regular CRA app, cause its libs are very coupled to the framework itself, for example, if you want to consume useRouter, you will need to share with it the RouterContext (used internally), then you will need to set up it on your shell app with it respective deps.
You should work with interfaces or some EDDL/Pub-Sub tool that communicates with the router layer of your application.
So you will be able to isolate and decouple the Router as a layer of your app and components that need to manipulate the router/navigation will have an interface to communicate in an abs…