[Ionic React] Functional component do not get correct location from useLocation hook

Thank’s for your reply.
The idea of this component is to have the whole logic of what to do when the application has no network. Then I do not want to move out the routing logic…

I finally transform this functional component in a class component and use componentDidMount, with this approach and by using withRouter decorator I get the correct location state from react-router.

I will definitely don’t understand why in my FC component the context of react-router is not correct :’(