jsx-eslint/eslint-plugin-react

Rule idea: no-mutation-props

Open

#1.113 geöffnet am 14. März 2017

Auf GitHub ansehen
 (6 Kommentare) (8 Reaktionen) (0 zugewiesene Personen)JavaScript (8.630 Stars) (2.797 Forks)batch import
help wantednew rulequestion

Beschreibung

A component is never meant to modify its own props (https://facebook.github.io/react/docs/components-and-props.html#props-are-read-only).

I suggest we had a no-mutation-props rule to check for mutations of a components own props. It looks like we could likely copy the logic used in no-direct-mutation-state.js.

Contributor Guide