M

valtio/v2/deep-clone-proxy-objects

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

In Valtio v2, the behavior of the proxy(obj) function has changed. In v1, proxy(obj) was a pure function that deeply copied the object obj. In v2, proxy(obj) is an impure function that deeply modifies obj. This codemod updates your code to accommodate these changes by incorporating deepClone to ensure that objects are deeply copied as they were in v1.

Example

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.