Skip to content

Instantly share code, notes, and snippets.

@andretw
Last active November 25, 2016 18:42
Show Gist options
  • Save andretw/2017ca03f65d1335119d3fec80f87aca to your computer and use it in GitHub Desktop.
Save andretw/2017ca03f65d1335119d3fec80f87aca to your computer and use it in GitHub Desktop.
[Stack overflow] ReactJS snippet
<!-- begin snippet: js hide: false console: true babel: true -->
<!-- language: lang-js -->
class Example extends React.Component {
constructor() {
super();
this.state = {
v: {
}
};
}
render() {
const dict = this.state.dict;
return (
<div>Here</div>
);
}
}
ReactDOM.render(<Example/>, document.getElementById('View'));
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<div id="View"></div>
<!-- end snippet -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment