Skip to content

E0101: JSX syntax error ​

The JSX in the file doesn't parse: an element isn't closed, a closing tag names another element, or a control-flow block (if, for, match) is missing its { … }.

An on… attribute holding statements (onClick={open = !open}) is a chain of browser commands. On a component it sets a prop, which takes the chain when its type is ui.JSChain (or any); a prop of a func type runs on the server and can't, so the statements are this error there. Declare the prop ui.JSChain and forward it to the element, <button onClick={OnClick}>.

Wrong ​

text
func Card(title string) ui.Node {
	return <div class="card">
		<p>{title}</div>
}
html
// Chip has OnClick func()
<Chip label="Manage" onClick={manage = !manage}/>
vuka
func Card(title string) ui.Node {
	return <div class="card">
		<p>{title}</p>
	</div>
}
html
// Chip has OnClick ui.JSChain, and renders <button onClick={OnClick}>
<Chip label="Manage" onClick={manage = !manage}/>

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.