26 ms·
I think a custom renderer for react would much more powerful. Currently JSX is just used as syntax sugar. Wasn’t some react ink project that more or less made t
by yuchi 3y ago
I think a custom renderer for react would much more powerful. Currently JSX is just used as syntax sugar. Wasn’t some react ink project that more or less made this?
- percyhanna 3y agoBy a custom renderer, are you referring to replacing the rendering process (e.g. ReactDOM) rather than replacing JSX? It's not clear to me how this would be better than swapping out the @jsx pragma. For rendering content to the Canvas, we have no need for all the overhead and complexity of React elements/components. There is no need or benefit in using the `React.createElement` (or its newer counterparts) to create React elements. But in theory, you're right that CanvaSX could have used React elements and rendered those instead of replacing the JSX pragma.
- pavlov 3y agoIt’s not terribly difficult to make your own React renderer, and it’s fun to have full control. I’ve written a React renderer that has both a canvas path for graphics and an automatically generated acceleration path for video layers: https://www.daily.co/blog/new-beta-dailys-video-component-system/ https://www.daily.co/blog/new-beta-dailys-video-component-sy... It’s open source, the code is here: https://github.com/daily-co/daily-vcs https://github.com/daily-co/daily-vcs