mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Update RulesOfHooks.js
This commit is contained in:
parent
a7e2223c35
commit
d5193147a6
|
|
@ -432,8 +432,7 @@ export default {
|
|||
'React Hook function.';
|
||||
context.report({node: hook, message});
|
||||
} else if (codePathNode.type === 'Program') {
|
||||
// We could warn here but there are false positives related
|
||||
// configuring libraries like `history`.
|
||||
// These are dangerous if you have inline requires enabled.
|
||||
const message =
|
||||
`React Hook "${context.getSource(hook)}" cannot be called ` +
|
||||
'at the top level. React Hooks must be called in a ' +
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user