so://phie

figure

The vanilla alternative for writing JSX-based React applications
git clone git://soophie.de/figure

blob: c3ddcd21bad97887ebf19ab63ab29f0d008f6f45 (487 bytes)[doc][blame][raw]

1# figure

2Reactive template literals for React

3

4### Example

5

6```javascript

7import figure from '...';

8

9const { html, dyn } = figure({ createElement });

10

11const global = createContext({});

12

13function App() {

14 const [name, setName] = useState('world');

15

16 const context = {};

17

18 return html`

19 ${dyn(global.Provider, { value: context }), html`

20 <h1>Hello ${name}!</h1>

21 <p>Some description text.</p>

22 `}

23 `;

24}

25

26render(createElement(App), document.querySelector('#root'));

27```