use javascript library in react

Solutions on MaxInterview for use javascript library in react by the best coders in the world

showing results for - "use javascript library in react"
Isaac
27 Sep 2016
1class MainView extends Component {
2  render() {
3    // don't render anything
4    return <div/>;
5  },
6
7  componentDidMount() {
8    // find the DOM node for this component
9    const node = ReactDOM.findDOMNode(this);
10
11    // widget does stuff
12    $(node).activateMyCoolWidget();
13
14    // start a new React render tree with widget node
15    ReactDOM.render(<div>{this.props.children}</div>, node);
16  }
17});