Closed pakettiale closed 2 years ago
Yeah, that would be nice. Makes sense. We didn't cover such use cases. Feel free to open a PR. If you have questions, let me know.
hi! i want to work on this issue, but it seems to work well.
https://codesandbox.io/s/react-typescript-forked-oe0v11?file=/src/App.tsx
am i missing something?
Hmm, I'm actually not very sure about the issue. @pakettiale Are you still around?
Hmm that codesandbox works for me too. Not sure why I then had issues originally. Maybe something else was conflicting :thinking:
But I think this issue can then be considered solved.
I modified the codesandbox. The problem seems to arise if I navigate to another page after changing the hash.
Can you check again? https://codesandbox.io/s/hcdjnj?file=/src/App.tsx
Setting
options.replaceState = true
causes the atom to overwrite current path with#{jotai_hash}
. I would think what it should instead writeprevious/path#{jotai_hash}
. Current implementation does not work well in SPAs that usereact-router
or similar libraries.If this is the case I could write a PR to solve this.