Skip to content

Instantly share code, notes, and snippets.

View stevoland's full-sized avatar

Stephen Collings stevoland

View GitHub Profile
@stevoland
stevoland / babel-plugin-react-hook-form-no-memo.md
Last active January 10, 2025 14:06
babel-plugin-react-hook-form-no-memo

react-hook-form (as of v7.53) may behave incorrectly when user code is compiled with react-compiler.

This babel plugin can be applied before the compiler to opt-out all functions which reference useForm by inserting the "use no memo" directive.

Only supports using the named export:

// worky
import { useForm } from 'react-hook-form
const Component = () => {