svenjsx

2.0.1 • Public • Published

SVENJSX

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>)
    }
});

Related Modules

ISC Licensed

Readme

Keywords

Package Sidebar

Install

npm i svenjsx

Weekly Downloads

0

Version

2.0.1

License

none

Unpacked Size

203 kB

Total Files

15

Last publish

Collaborators

  • svenanders