-
Notifications
You must be signed in to change notification settings - Fork 50.8k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
Since React 19 devs can pass ref directly as a prop (forwardref is not needed anymore) , but now eslint-plugin-react-hooks is complaining about valid code
React version: 19.1.1
eslint-plugin-react-hooks: 7.0.1
Steps To Reproduce
import type { Ref } from 'react';
import {
StyleProp,
TextInput as RNTextInput,
TextInputProps,
TextStyle,
} from 'react-native';
import { TextInput } from '../TextInput';
function TextArea(
props: TextInputProps & {
ref?: Ref<RNTextInput | null>;
style?: StyleProp<TextStyle>;
},
) {
return (
<TextInput
ref={props.ref} // Eslint error: react-hooks/refs
type="body"
/>
);
}
export { TextArea };The current behavior
Error
ref={props.ref} // Eslint error: react-hooks/refs
The expected behavior
No error, valid react 19 code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug