Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andersekdahl/23c63e7a976d0af7a7f858f84ff4074b to your computer and use it in GitHub Desktop.
Save andersekdahl/23c63e7a976d0af7a7f858f84ff4074b to your computer and use it in GitHub Desktop.
findDOMNode
class Editable extends React.Component {
componentDidMount() {
const node = ReactDOM.findDOMNode(this);
// Do stuff with the DOM node to make both React and
// the CMS we use happy
}
render() {
if (this.props.Component) {
return <this.props.Component {...this.props} />;
} else {
return <div>{this.props.content}</div>;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment