This library allows you to use the JSX notation with maquette. This allows you to write code like this:
let render = () => {
return <div>
{ nameInput.render() }
<p class="output">
Hello {name || 'you'}!
</p>
</div>;
}
- Install maquette-jsx by running
npm install maquette maquette-jsx
- When using Typescript: Add the following lines to your
tsconfig.json
:"jsx": "react"
"jsxFactory": "jsx"
- When using babel: Add the following plugin:
"plugins": [ ["transform-react-jsx", {"pragma": "jsx"}] ]
- Call maquette-jsx's
enableGlobalJsx
function before calling maquette'screateProjector()
- You can now return JSX from your
render
functions
https://github.com/AFASSoftware/maquette-typescript-jsx-starter