Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 500 Bytes

jsx-no-new-array-as-prop.md

File metadata and controls

25 lines (15 loc) · 500 Bytes

Prevent [...] as JSX prop values (jsx-no-new-object-as-prop)

Prevent Arrays that are local to the current method from being used as values of JSX props

Rule Details

The following patterns are considered warnings:

<Item list={[]} />

<Item list={new Array()} />

<Item list={Array()} />

<Item list={this.props.list || []} />

<Item list={this.props.list ? this.props.list : []} />

The following patterns are not considered warnings:

<Item list={this.props.list} />