Skip to content
Filatov Dmitry edited this page Feb 18, 2018 · 12 revisions

With vidom you can build isomorphic applications. You're able to render HTML markup on server and then reuse it on client using the same code.

On server

import { renderToString } from 'vidom';

const html = renderToString(<MyApp/>);

// then insert given html into <div id="root"></div>

In browser

import { mount } from 'vidom';

mount(document.getElementById('root'), <MyApp/>);

Note

Be careful, Vidom uses naive approach that a passed virtual tree corresponds to existing DOM tree.