Skip to content

Can a NextJS Remote work in a CRA Host? #494

Closed Answered by brunos3d
clodal asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@spulugam
Comment options

Answer selected by clodal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants