use-immer
use-immer copied to clipboard
React Compiler Bug
Hi,
Following line, i believe is an invalid hook call. The problem was that useCallback was being returned directly without being defined as a constant first. When i copied the index.ts file into my project and changed the code to define useCallback as a const before returning it, the error was resolved.
https://github.com/immerjs/use-immer/blob/master/src/index.ts#L19-L22
It is very invalid. hook calls must only we written at the root of a function and not be nested in any way.