useEffect Hook execute 3 lifecycle i.e., [componentDidMount, componentDidUpdate and ComponentWillUnmount].
With this I am trying to reload my page only once if Country
page is visited..
https://codesandbox.io/s/angry-nash-rc98mw?file=/src/index.js
Question: How to make this working using Route.
root.render(
<BrowserRouter>
<Routes>
<Route path="/" Component={App} />
<Route path="/country" Component={Country} />
</Routes>
</BrowserRouter>
);
If Can help answering the following POST. I'd appreciate it.
https://github.com/WICG/webcomponents/issues/754
SO SOLUTION I CAN THINK OF IS
RELOAD THE PAGE.
I have created my Custom element using react-to-webcomponent