mobx-react-router: Newly created store missing history and location in react-router 6.x

Hi there!

I am using react-router @6.21 and it seems now mobx RouterStore is missing the History and Location. How should I ensure the history is synced with the router in the new react-router syntax?

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 31

Most upvoted comments

@kkollman No worries. I pushed the changes in progress to another branch and released v6.0.0-alpha on NPM. It seems that vite.js is able to start with this new version. Give it a try when you have time πŸ˜‰

Okay, I can finally say: done! πŸŽ‰ The last missing puzzle was to properly configure vite.js plugins. Now I can say your solution is fully working πŸ˜ƒ Thank you very much! It’s been a while, but we finally made it πŸ˜ƒ

Cool, we are making some progress πŸ˜ƒ I finally was able to set up the stackblitz, with a simple example.

https://stackblitz.com/edit/github-bje76z-uyn64v?file=src%2Fmain.jsx

If you have some time, can you try to see if you can reproduce your bug there?

Oops!

Let try:

npm install git+https://github.com/IBM/mobx-react-router.git#master

or

yarn add git+https://github.com/IBM/mobx-react-router.git#master

@gcattan unfortunately, it’s a private codebase and I cannot share it. But I’ll try the branch you mentioned now!