[React 19]: eslint-plugin-react-compiler
gives false positive if hook takes generics
#29062
Labels
eslint-plugin-react-compiler
gives false positive if hook takes generics
#29062
Summary
(Not sure if this should be filed under React 19?)
The following code triggers
Hooks may not be referenced as normal values, they must be called. See https://react.dev/reference/rules/react-calls-components-and-hooks#never-pass-around-hooks-as-regular-values
(
useQueryClient
anduseMutation
coming from@tanstack/react-query
, fwiw)Either removing the
<Data>
generic, or the precedinguseQueryClient
resolves the error.This is using
eslint-plugin-react-compiler@0.0.0-experimental-e04a001-20240515
Anyways, I'm super excited that you've finally open sourced this, and look forward to using it!
(I do wonder why
pretty-format@24
is used in the babel plugin tho 👀 very old!)The text was updated successfully, but these errors were encountered: