million icon indicating copy to clipboard operation
million copied to clipboard

`useSyncExternalStore` is broken

Open steveruizok opened this issue 1 year ago • 0 comments

https://github.com/aidenybai/million/blob/7547fa81ccb0e1a66d5ea4bbba35788190e399bf/packages/react/hooks.ts#L235-L242

I don't think this matches the behavior of React's own useSyncExternalStore. I believe it should subscribe only the state setter, rather than the [state, stateSetter] returned from useState. Also, it may re-subscribe on every update.

steveruizok avatar Jul 31 '22 11:07 steveruizok