3 ms·
I haven't used React, but the approach you describe sounds very much like how early C++ UI toolkits worked. Applications would be built of "reusable, nested com
by Pacabel 13y ago
I haven't used React, but the approach you describe sounds very much like how early C++ UI toolkits worked. Applications would be built of "reusable, nested components", often called "widgets". The widgets would be placed into a hierarchy, with widgets often creating their ancestors. Widgets would have a paint() method that would take the widget's internal state and the state of the widget's container(s) into account when displaying (or updating a previous display) of the widget.
- Pacabel
- pygy_ 13y agoJust to let you know: the guidelines ask not to sign your (otherwise perfectly good) comments. http://ycombinator.com/newsguidelines.html http://ycombinator.com/newsguidelines.html
- wavefunction 13y agoOne thing I'm not clear from your description is... The widgets were tightly-coupled with their ancestors? (In order to create them)
- ori_b 13y agoIn general, no. You would typically take your widget, create it, and put it into a widget-agnostic container or layout manager. The widget wouldn't know about it's parent or children. The widgets would communicate by sending signals which bubbled up or down the container heirarchy, triggering repaints, resizes, and so on as needed. Of course, this varied by toolkit.
- drcode 13y agoYou're only seeing one small similarity- React components are very different from old-school components.