|
|
|
|
|
by jcelerier
1602 days ago
|
|
Words don't have any meaning anymore if react (and the HTML DOM) is considered anything close to "immediate mode". For starters the DOM is a declarative thing - immediate mode means that you have a function called for each frame with imperative function calls written by the user of the immediate mode GUI toolkit for rendering each element of the GUI every time (unlike retained mode where a framework hides that behind some object model). It's not really possible to be more opposite to a declarative approach. |
|
It suggests a particular implementation, but in practice most nontrivial "immediate mode" GUI libraries (including egui [1] and the famous Dear-IMGUI [2] [3] ) retain some "shadow state" between frames. The existence or scope of that state is a (sometimes-leaky) implementation detail that shouldn't distract from the fact that the API presented is still "immediate mode."
[1] https://github.com/emilk/egui#ids
[2] https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-a...
[3] https://github.com/ocornut/imgui/wiki/About-the-IMGUI-paradi...