Answer the question
In order to leave comments, you need to log in
How to make a component in react that will be available on all pages?
There was a need to open a modal window for a user who has not changed his data in the personal account for a long time. It is necessary that it opens independently several times a day and regardless of which page the user is on, and there are many pages.
Is it possible to somehow implement a component that will be available from everywhere, without having to import it on every page? Tell me which way to dig? Maybe portals, maybe somehow you can run from redax, but the main thing is that the modal is initialized once.
Answer the question
In order to leave comments, you need to log in
Connect it in the main component or in the component with the router
<Fragment>
<Modal />
<Router />
</Fragment>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question