Mmanishjha-04

valtio/v2/use-snapshot-migration

No description available

valtiov2migration
Public
0 executions

Run locally

npx codemod valtio/v2/use-snapshot-migration

This codemod automates the migration of Valtio code to accommodate changes in the behavior of useSnapshot(). In recent updates, useSnapshot() has been modified for better compatibility with useMemo and the upcoming React compiler. This codemod updates your code to ensure optimal performance and compatibility with these changes.

You can find the implemetation of this codemod in the studio here.

Example

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.