When using react/display-name
certain false warnings are given for Enact kinds. This rule replaces react/display-name
for use with kind()
.
This rule supersedes react/display-name
. Be sure to disable react/display-name
in your config.
The following patterns are considered warnings:
const Hello = createReactClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
The following patterns are not considered warnings:
const Hello = kind({
name: 'Example',
render: function () {
return <div>Hello World</div>;
}
});
...
"enact/display-name": [<enabled>, { "ignoreTranspilerName": <boolean> }]
...
See display-name at eslint-plugin-react for more information.
For this rule to work we need to detect React components, this could be very hard since components could be declared in a lot of ways.
For now we should detect components created with:
createReactClass()
- an ES6 class that inherit from
React.Component
orComponent
- a stateless function that return JSX or the result of a
React.createElement
call.