Mmanishjha-04

valtio/v2/use-snapshot-migration

No description available

Legacy
valtiov2migration
Public
0 downloads
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

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.