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?
By 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|1 year ago
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-sy...
It’s open source, the code is here:
https://github.com/daily-co/daily-vcs
percyhanna|1 year ago
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.