maquette-jsx
v3.0.1
Published
A library to enable maquette to use jsx
Downloads
1,311
Keywords
Readme
maquette-jsx
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>;
}
Getting started
- 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
Example
https://github.com/AFASSoftware/maquette-typescript-jsx-starter