Support multiple React apps #8647
Unanswered
ondrejvelisek
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
imagine situation where developer uses more react apps.
Eg. while gradually migrating project from some legacy component framework to React. Going from leaf components (single React apps) gradually merging them into bigger and bigger ones untill whole app is migrated. (our case but believe it is a common approach)
We encounter a problem, that multiple React Routers (
<HashRouter/>
) does not share some context.e.g.
navigate
fromuseNavigate
called from<AppA/>
does not trigger rerenders in<AppB/>
and<AppC/>
viauseMatch
and<Route/>
.I was suprised by this behaviour (using RR v6). I thought that anything I do via
react-router
will manipulate Browser page state, it triggers some global callback which all HashRouters are listening to internally and triggers its rerenders. Am I wrong?Anyway. Is there a way to obtain such behaviour in
react-router
?Lastly I will point out, that other libraries solves this by some shared context configuration. Examples:
react-query
react-redux
okta-react
Sorry if missunderstood something and thank you for constructive discussion and answers. :)
Beta Was this translation helpful? Give feedback.
All reactions