react/no-render-return-value
eslint-plugin-react
No autofixRecommended
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-render-return-value": "error",
},
},
];const inst = ReactDOM.render(<App />, document.body);
doSomethingWithInst(inst);ReactDOM.render(<App ref={doSomethingWithInst} />, document.body);
ReactDOM.render(<App />, document.body, doSomethingWithInst);Examples from the ESLint documentation.
react/no-render-return-value
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-render-return-value": "error",
},
},
];react/no-render-return-value
react plugin · correctness
{
"plugins": [
"react"
],
"rules": {
"react/no-render-return-value": "error"
}
}correctness/noRenderReturnValue
correctness · since 1.0.0
{
"linter": {
"rules": {
"correctness": {
"noRenderReturnValue": "error"
}
}
}
}Disallow passing of children as props
Disallow missing key props in iterators/collection literals
Enforce ES5 or ES6 class for returning value in render function