|
|
|
|
|
by 8n4vidtmkvmk
1207 days ago
|
|
I recently started ripping Mobx out of my app. Mobx solved exactly 1 problem for me, which was passing data horizontally (to siblings/cousins) and even to non-React components. But now `useSyncExternalStore` solves that. No context needed. Can read and write state anywhere, even outside components. No "observe" or "track" shenanigans. Efficient updates (can listen to a subsection of the tree). |
|
Its still not quite as nice as MobX, as passing larger objects down the component tree means you need to mix snapshot and non-snapshot state. But it makes me hopeful about `useSyncExternalStore`