diff --git a/docs/src/pages/getting-started/faq/faq.md b/docs/src/pages/getting-started/faq/faq.md index 9b94c69906cad5..5cb03e0c512586 100644 --- a/docs/src/pages/getting-started/faq/faq.md +++ b/docs/src/pages/getting-started/faq/faq.md @@ -90,41 +90,7 @@ export default withTheme()(withStyles(styles)(Modal)); ## How can I access the DOM element? -You can use the `ref` property in conjunction with the [`findDOMNode()`](https://reactjs.org/docs/react-dom.html#finddomnode) React API. Or you can [use an abstraction](https://github.com/facebook/react/issues/11401#issuecomment-340543801): - -```jsx -import React from 'react'; -import ReactDOM from 'react-dom'; -import PropTypes from 'prop-types'; - -class RootRef extends React.Component { - componentDidMount() { - this.props.rootRef(ReactDOM.findDOMNode(this)) - } - - componentWillUnmount() { - this.props.rootRef(null) - } - - render() { - return this.props.children - } -} - -RootRef.propTypes = { - children: PropTypes.element.isRequired, - rootRef: PropTypes.func.isRequired, -}; - -export default RootRef; -``` - -Usage: -```jsx - { console.log(node) }}> - - -``` +Wrap the component with the [``](/api/root-ref) helper. ## Why are the colors I am seeing different from what I see here?