-
Notifications
You must be signed in to change notification settings - Fork 50.1k
Closed as not planned
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: 18
eslint-plugin-react-hooks version: 4.6.2
Steps To Reproduce
Run eslint. with eslint-plugin-react-hooks with the following two code:
- useEffect:
const App = ({ id }: { id: string }) => {
useEffect(() => {
document.title = id;
}, []);
};- useInsertionEffect:
const App = ({ id }: { id: string }) => {
useInsertionEffect(() => {
document.title = id;
}, []);
};The current behavior
The plugin reports a warning for the first case and doesn't for the second.
The expected behavior
For both cases the plugin should report a warning.
As a workaround, I currently have to update the config:
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: 'useInsertionEffect',
},
],
glyph-cat
Metadata
Metadata
Assignees
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug