Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 706 Bytes

coconut-vs-react.md

File metadata and controls

34 lines (30 loc) · 706 Bytes
React Coconut / Haxe
Setting state
onClick={() => this.setState({ count: this.count + 1 })}
onclick=${count++}
Iteration
render: function() {
	const elements = ['one', 'two', 'three'];
	return (
		<ul>
			{elements.map((value, index) => {
				return <li key={index}>{value}</li>
			})}
		</ul>
	)
}
function render() '
	<for ${index => value in ... ['one', 'two', 'three']}>
		<li key={index}>{value}</li>
	</for>
';