This codemod migrates from using useContext(EditorContext)
to the new useSlate()
hook in Slate. It transforms the editor state management approach and adds new state hooks.
Before
const MyComponent = () => {const editor = useContext(EditorContext);// ...};
After
const MyComponent = () => {const editor = useSlate();// Access editor state using new hooksconst selected = useSelected();const focused = useFocused();// ...};
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community