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

Rendering 0 #354

Closed Yomguithereal closed 8 years ago

Yomguithereal commented 8 years ago

The following:

const Component = {
  render() {
    return <div>{0}</div>;
  }
};

will not render a text node containing the 0 string.

Is that expected behavior?

rstacruz commented 8 years ago

Thanks for trying it out, I believe this was previously discussed in #321 (and maybe #255). can you try it with the latest rc version?

Yomguithereal commented 8 years ago

I am using 2.0.0-rc7.

anthonyshort commented 8 years ago

https://github.com/dekujs/deku/blob/master/test/createDOMRenderer.js#L127-L137

It's probably using some silly falsy check somewhere. It should be too hard to track down, but you might just need to follow the code path. It could happen in element, diff or patch.