3 ms·
Isn't drawRect: working at a different level of abstraction than React? In React, the view function constructs a virtual DOM tree, which can contain links, butt
by mwcampbell 11y ago
Isn't drawRect: working at a different level of abstraction than React? In React, the view function constructs a virtual DOM tree, which can contain links, buttons, form fields, tables, etc. The equivalent on OS X would construct NSControls or NSCells, or objects that ultimately got translated into those, rather than just drawing on a canvas.
- mpweiher 11y agoI saw this as react choosing the obvious way to implement drawRect: inside a browser: painting with HTML. You could easily have a "graphics context" that accepts high-level objects, or a variant of drawRect: that creates subviews and then tells those subviews to draw themselves. I don't see this as being fundamentally/structurally different, though there is a slight difference in the implementation.