Skip to content

Instantly share code, notes, and snippets.

@ihgrant
ihgrant / example.js
Last active January 25, 2016 17:39
react controller outside react component
const Controller = (function () {
let currentRows = [];
const addRow = function (newRow) {
// add a new row to our local variable
render();
};
const render = function () {
ReactDOM.render(<Form onSubmit={addRow}/>, document.getElementById('myform'));
ReactDOM.render(<Rows rows={currentRows}/>, document.getElementById('myrows'));
};