What version of Oxlint are you using?
1.66.0
What command did you run?
oxlint --rule react/no-unstable-nested-components
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
What happened?
The rule fires on event handler callbacks that pass JSX to a helper function like showToast. These are not component definitions — the arrow function does not return JSX.
Minimal reproduction:
function MyComponent() {
return (
<Button
onClick={() => {
showToast(<Toast label=\"Button clicked\" />);
}}
/>
);
}
The onClick handler never returns JSX — it calls showToast as a side effect. The <Toast /> element is an argument to a function call, not an inline component definition.
Other patterns that incorrectly trigger:
useMutation(MUTATION, {
onCompleted: (data) => { // ← flagged, but this is a void callback
if (data.errors) { showToast(<ErrorToast />); }
},
});
Expected behavior
The rule should only fire when an arrow function returns JSX (render prop / component factory). It should not fire when JSX is merely passed as an argument inside a void callback. The eslint-plugin-react implementation does not flag these patterns.
What version of Oxlint are you using?
1.66.0
What command did you run?
oxlint --rule react/no-unstable-nested-components
What does your
.oxlintrc.json(oroxlint.config.ts) config file look like?{ "rules": { "react/no-unstable-nested-components": "error" } }What happened?
The rule fires on event handler callbacks that pass JSX to a helper function like
showToast. These are not component definitions — the arrow function does not return JSX.Minimal reproduction:
The
onClickhandler never returns JSX — it callsshowToastas a side effect. The<Toast />element is an argument to a function call, not an inline component definition.Other patterns that incorrectly trigger:
Expected behavior
The rule should only fire when an arrow function returns JSX (render prop / component factory). It should not fire when JSX is merely passed as an argument inside a void callback. The eslint-plugin-react implementation does not flag these patterns.