This file contains hidden or 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
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')); | |
}; |
NewerOlder