anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.41k stars 130 forks source link

Hot module replacement docs are out of date #406

Open Zacqary opened 8 years ago

Zacqary commented 8 years ago

The instructions for Hot Module Replacement cause errors in the latest version of Deku. This section doesn't work:

import {dom, element} from 'deku';
import Application from './components/Application.jsx';

const render = dom.createRenderer(document.getElementById('mount'));

// Rendering function
function update (Component) {
  render(<Component />)
}

// First render
update(Application);

What works for me is:

import {createApp, element} from 'deku';
const render = createApp(document.getElementById('mount'));