Skip to content

Instantly share code, notes, and snippets.

@michaelrambeau
Created March 3, 2016 22:25
Show Gist options
  • Save michaelrambeau/34a3345eae1bf06aa079 to your computer and use it in GitHub Desktop.
Save michaelrambeau/34a3345eae1bf06aa079 to your computer and use it in GitHub Desktop.
react fire simple test
const App = React.createClass({
mixins: [ReactFireMixin],
increment() {
this.setState({counter: this.state.counter + 1})
},
reset() {
this.setState({counter: 0})
},
render() {
return (
<div>
counter=
{this.state.counter}
<button type="button" onClick={this.increment}>increment</button>
</div>
);
}
});
// Start the application
ReactDOM.render(
React.createElement(App),
document.getElementById('app')
);
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.js"></script>
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/2.4.1/firebase.js"></script>
<!-- ReactFire -->
<script src="https://cdn.firebase.com/libs/reactfire/0.6.0/reactfire.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>reactfire simple test</title>
</head>
<body>
<div id="app"></div>
<script type="text/babel" src="app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment