Skip to content
public-library›Rules›React›Avoid copying props to state

Avoid copying props to state

HIGH#react#state#props Sign in to star Avoid copying props to state, 0 stars

Sign in to star rules

Star this rule if you find it useful.

Do not copy a prop into state to mirror it. Read the prop directly, lift the state to the parent, or reset local state with a key when the prop identifies a different item.

In the full rule