The vanilla alternative for writing JSX-based React applications
git clone git://soophie.de/figure
blob: c3ddcd21bad97887ebf19ab63ab29f0d008f6f45 (487 bytes)[doc][blame][raw]
1
# figure2
Reactive template literals for React4
### Example6
```javascript7
import figure from '...';9
const { html, dyn } = figure({ createElement });11
const global = createContext({});13
function App() {14
const [name, setName] = useState('world');16
const context = {};18
return html`19
${dyn(global.Provider, { value: context }), html`20
<h1>Hello ${name}!</h1>21
<p>Some description text.</p>22
`}23
`;24
}26
render(createElement(App), document.querySelector('#root'));27
```