JSX275 Documents

Prop Destructuring Ownership

Destructure props only in components that consume them. This usually means leaf components destructure props, although intermediate components may do so when they consume specific prop values themselves.

Correct

export default props => <Card {...props} />
export default ({ title }) => <h1>
    {
        title
    }
</h1>

Incorrect

export default ({ title }) => <Card title={title} />

Fix

Forward the original props object; destructure values only when consumed locally. This check detects parameter bindings used only as component attributes.