component navigation without changin the url react router

JavaScript
const memoryHistory = createMemoryHistory(options);

// In your Router configuration
<Router history={memoryHistory} routes={routes} />
Source

Also in JavaScript: