-
Notifications
You must be signed in to change notification settings - Fork 16
Isomorphism
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.
import { renderToString } from 'vidom';
const html = renderToString(<MyApp/>);
// then insert given html into <div id="root"></div>
import { mount } from 'vidom';
mount(document.getElementById('root'), <MyApp/>);
Be careful, Vidom uses naive approach that a passed virtual tree corresponds to existing DOM tree.