Don't use incorrectly spelled React APIs |
When calling React APIs, pay extra attention that they are properly spelled
CheckId | RCT010112 |
---|---|
TypeName | ReactMethodTypoRule |
Severity | Error |
Type | React component |
When calling React APIs, pay extra attention that they are properly spelled. Using incorrect spelling or casing can lead to runtime errors and side-effects.
Bad practice (incorrectly cased componentWillMount method)
export class Message extends React.Component {
componentWillmount() {
}
render() {
return <div>{this.props.message}</div>;
}
}
componentWillmount() {
}
render() {
return <div>{this.props.message}</div>;
}
}
Good practice (method componentWillMount correctly cased)
export class Message extends React.Component {
componentWillMount() {
}
render() {
return <div>{this.props.message}</div>;
}
}
componentWillMount() {
}
render() {
return <div>{this.props.message}</div>;
}
}
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.