warnForInvalidEventListener() — react Function Reference
Architecture documentation for the warnForInvalidEventListener() function in ReactDOMComponent.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD b98b4c7e_a5fc_744a_2478_0278e64cf8e0["warnForInvalidEventListener()"] 1e990658_7cea_75be_1f24_2399bdf9f15b["ReactDOMComponent.js"] b98b4c7e_a5fc_744a_2478_0278e64cf8e0 -->|defined in| 1e990658_7cea_75be_1f24_2399bdf9f15b 5a792874_dbaf_1dd0_9e62_d6a16580e0b5["setProp()"] 5a792874_dbaf_1dd0_9e62_d6a16580e0b5 -->|calls| b98b4c7e_a5fc_744a_2478_0278e64cf8e0 65717281_efda_4b8d_7a97_9947c26aa05e["setPropOnCustomElement()"] 65717281_efda_4b8d_7a97_9947c26aa05e -->|calls| b98b4c7e_a5fc_744a_2478_0278e64cf8e0 b3ccac7d_1304_9653_2f32_5c5e2bbc637e["diffHydratedCustomComponent()"] b3ccac7d_1304_9653_2f32_5c5e2bbc637e -->|calls| b98b4c7e_a5fc_744a_2478_0278e64cf8e0 409bfd4f_a0a2_7b82_31de_9321ab006da0["diffHydratedGenericElement()"] 409bfd4f_a0a2_7b82_31de_9321ab006da0 -->|calls| b98b4c7e_a5fc_744a_2478_0278e64cf8e0 style b98b4c7e_a5fc_744a_2478_0278e64cf8e0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-dom-bindings/src/client/ReactDOMComponent.js lines 296–315
function warnForInvalidEventListener(registrationName: string, listener: any) {
if (__DEV__) {
if (listener === false) {
console.error(
'Expected `%s` listener to be a function, instead got `false`.\n\n' +
'If you used to conditionally omit it with %s={condition && value}, ' +
'pass %s={condition ? value : undefined} instead.',
registrationName,
registrationName,
registrationName,
);
} else {
console.error(
'Expected `%s` listener to be a function, instead got a value of `%s` type.',
registrationName,
typeof listener,
);
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does warnForInvalidEventListener() do?
warnForInvalidEventListener() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/ReactDOMComponent.js.
Where is warnForInvalidEventListener() defined?
warnForInvalidEventListener() is defined in packages/react-dom-bindings/src/client/ReactDOMComponent.js at line 296.
What calls warnForInvalidEventListener()?
warnForInvalidEventListener() is called by 4 function(s): diffHydratedCustomComponent, diffHydratedGenericElement, setProp, setPropOnCustomElement.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free