Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:jsx-react/no-deprecated
Language: JavaScript
Severity: Warning
Category: Error Prone
Description
As React evolves, methods are deprecated over time. This rule warns you about deprecated methods.
Non-Compliant Code Examples
React.render(<MyComponent/>,root);React.unmountComponentAtNode(root);React.findDOMNode(this.refs.foo);React.renderToString(<MyComponent/>);React.renderToStaticMarkup(<MyComponent/>);React.createClass({/* Class object */});//Any factories under React.DOM
React.DOM.div();importReact,{PropTypes}from'react';// old lifecycles (since React 16.9)
componentWillMount(){}componentWillReceiveProps(){}componentWillUpdate(){}// React 18 deprecations
import{render}from'react-dom';ReactDOM.render(<div></div>,container);import{hydrate}from'react-dom';ReactDOM.hydrate(<div></div>,container);import{unmountComponentAtNode}from'react-dom';ReactDOM.unmountComponentAtNode(container);import{renderToNodeStream}from'react-dom/server';ReactDOMServer.renderToNodeStream(element);