Integrate the widget within your router
React Router v6
and uses it internally for page navigation.
React Router
context, we check if the widget component is inside the context and, if so, utilize it instead of creating a new one.
The below code shows an example of correctly setting the path to a page with the widget component.