Last active
January 7, 2018 16:55
-
-
Save denisraslov/a3e14f190400b5c414b90cd26c660a84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import DashboardView from 'views/dashboard'; | |
class DashboardPage extends React.PureComponent { | |
// render an empty DIV and save a reference to it | |
render() { | |
return <div ref={node => this.node = node}></div>; | |
} | |
componentDidMount() { | |
// render a Backbone view into the referenced DIV | |
this.dashboardView = new DashboardView(this.node, this.props); | |
this.dashboardView.render(); | |
} | |
componentWillUnmount() { | |
// don't forget to clean up after Backbone | |
this.dashboardView.remove(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment