var yourName = ''; // Piece of data | |
// Plain event handler | |
function handleNameInput(evt) { | |
yourName = evt.target.value; | |
} | |
// This function uses the 'hyperscript' notation to create the virtual DOM. | |
function renderMaquette() { | |
return h('div', [ | |
h('input', { | |
type: 'text', placeholder: 'What is your name?', | |
value: yourName, oninput: handleNameInput | |
}), | |
h('p.output', ['Hello ' + (yourName || 'you') + '!']) | |
]); | |
} | |
projector.append(domNode, renderMaquette); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment