SVENJSX is a support tool for SvenJS. It allows you to write JSX syntax in your render code, like this:
var Sven = require("svenjs");
var clickyComponent = Sven.create({
initialState: {
clicks: 0
},
render() {
let svenFunc = () =>{
this.setState({clicks: this.state.clicks++ });
}
return (<div id="row">
<div id="app">
<h3>The Click App</h3>
<button onClick={svenFunc}>Why not click me?</button>
</div>
<div id="time-travel">
<h3>Click stats</h3>
<p>You have clicked on the button {this.state.clicks} times</p>
</div>
</div>)
}
});
- svenjsx-loader - Webpack loader for SVENJSX.