jotaijs / jotai-scope

MIT License
55 stars 4 forks source link

Can't use with reducer #16

Closed ImSingee closed 7 months ago

ImSingee commented 9 months ago

If used with reducer, the changes in the inner scope won't affect the outer.

Re-Produce: https://codesandbox.io/p/sandbox/zealous-framework-jnlrvf

(Count should be in sync, but not)

dai-shi commented 8 months ago

Thanks for reporting. Hmm, your code looks okay. Are you sure if this issue is only with atomWithReducer? Using atom doesn't cause it?

ImSingee commented 8 months ago

@dai-shi Yes I’m sure there’s not problem with pure atom

dai-shi commented 8 months ago

@yf-yang do you notice something?

dai-shi commented 8 months ago

I actually don't understand where is the bug. It would be nice if we could find it. I hope to try it.

dai-shi commented 7 months ago

My hope was https://github.com/pmndrs/jotai/pull/2351 would fix completely, but there still seems to be an issue in jotai-scope.