Is ReactJS IMGUI?

Xuan Huang
1 min readOct 13, 2016

Great Post!

While I don’t think React belongs to the traditional concept of Immediate Mode, in which drawing commands directly cause actual rendering (sometimes directly sent to GPU).

In contrast, ReactJS does maintain a Virtual DOM as the internal display list (or tree). For every states’ update, React “diffs” the VDOM and generates bunch of DOM calls to update the actual DOM, and that is exactly how browsers maintain the DOM: compute the layout, generate draw commands and send them into GPU for rasterization. This is Retained Mode.

However, ReactJS allows application code to act as if it were immediate mode by declaring what to render, instead of how to render. And that brings part of the benefits of the paradigm of Immediate Mode, the complexity reducing, or the “permutation-agnostic”, but not including the low memory cost and low indirection cost etc.

That may be the reason why the whole community switched to the Functional Programming concepts. Considering ReactJS as IMGUI library is partial correct (for the dev experiences and mental model), but it’s inaccurate.

--

--

Xuan Huang

@huxpro At twitter/github. Team Web. Worked at Facebook, Alibaba, WePiao.com, Ele.me. Spoke at JSConfCN, QCon, GDG.