Replies: 1 comment
-
Hey! This is a really interesting idea, and I think a general-purpose renderer for non-DOM environments could be super valuable — especially for niche use cases like CLI tools, PDFs, or canvas-based apps. Right now, projects like ink and react-pdf have to maintain their own custom renderers, which means a lot of repeated effort and risk of breaking changes whenever React’s internal APIs shift. Having a lightweight, base renderer (maybe something like react-generic-renderer) that handles the core reconciliation but lets you define how elements are rendered would definitely help reduce that friction. I haven’t seen anything like this officially endorsed by the React team yet, but I think it aligns with React’s long-term vision of being platform-agnostic. If nothing else, it could serve as a great reference or starter kit for other developers looking to build renderers. I’d definitely be interested in seeing how this could be structured — sounds like a project with real potential! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi React team and community,
I've been exploring ways to use React in non-DOM environments like the command line (e.g. with
ink
) and PDF generation (react-pdf
), and I'm amazed by how flexible React's reconciler architecture is. However, each of these projects reimplements a custom renderer, which can be hard to maintain as React evolves.Idea:
Would it be worth considering the development (or official endorsement) of a minimal, general-purpose renderer for non-DOM environments?
This could:
What it could look like:
react-generic-renderer
package that renders to an in-memory tree.onRender(element)
).Questions for discussion:
I’d love to hear the community’s thoughts on this — happy to help or collaborate if others are interested in this too.
Thanks for reading!
Beta Was this translation helpful? Give feedback.
All reactions