How to resolve eslint error: “prop spreading is forbidden” in a custom route component?

ES lint discourages the use of prop spreading so that no unwanted/unintended props are being passed to the component.
More details here: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md

To disable it for the particular file, you can put: /* eslint-disable react/jsx-props-no-spreading */ at the top line in your component file.
For disabling it for all files, try this: Disable in EsLint “react / jsx-props-no-spreading” error in Reactjs

Edited comments as per answer below

Leave a Comment