facebook/react · error · Error
231
231
Error message
Expected `${registrationName}` listener to be a function, instead got a value of `${typeof listener}` type. What it means
Error "Expected `${registrationName}` listener to be a function, instead got a value of `${typeof listener}` type." thrown in facebook/react.
Source
Thrown at packages/react-native-renderer/src/legacy-events/ResponderEventPlugin.js:255
fn(path[i], 'bubbled', arg);
}
}
function getListener(inst, registrationName) {
const stateNode = inst.stateNode;
if (stateNode === null) {
// Work in progress (ex: onload events in incremental mode).
return null;
}
const props = getFiberCurrentPropsFromNode(stateNode);
if (props === null) {
// Work in progress.
return null;
}
const listener = props[registrationName];
if (listener && typeof listener !== 'function') {
throw new Error(
`Expected \`${registrationName}\` listener to be a function, instead got a value of \`${typeof listener}\` type.`,
);
}
return listener;
}
function listenerAtPhase(inst, event, propagationPhase: PropagationPhases) {
const registrationName =
event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(inst, registrationName);
}
function accumulateDirectionalDispatches(inst, phase, event) {
if (__DEV__) {
if (!inst) {
console.error('Dispatching inst must not be null');
}View on GitHub (pinned to eafeac097b)
When it happens
Trigger: Thrown at packages/react-native-renderer/src/legacy-events/ResponderEventPlugin.js:255 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/035072e405749161.
Report an issue: GitHub.