Skip to content

Instantly share code, notes, and snippets.

@rajat1saxena
Last active January 26, 2018 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajat1saxena/487e8b0054d061b08ad85681ca5d81ce to your computer and use it in GitHub Desktop.
Save rajat1saxena/487e8b0054d061b08ad85681ca5d81ce to your computer and use it in GitHub Desktop.
class Counter extends React.Component {
constructor() {
super();
// define the internal state of the component
this.state = {name: 'rajat'}
}
render() {
return (
<div>
{this.state.name}
</div>
);
}
}
// Usage:
// In your react app: <Counter />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment