Replies: 2 comments
-
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.
-
This idea hits at a structural blind spot in how the React ecosystem has evolved. React’s reconciler is general purpose by design, but not by ergonomics. Projects like Ink, react pdf, and even experimental renderers for Canvas or WebGL all end up duplicating the same scaffolding just to get to the point where they can start building their core logic. Every one of them is writing their own host config, managing edge cases, chasing React version changes, and debugging internals that aren’t intended to be stable , it’s a lot of overhead to unlock a pattern that React fundamentally supports. The proposal for a minimal, official renderer doesn’t need to be about full featured output in fact, it shouldn’t be. It should be a reference implementation: the simplest viable contract between the reconciler and a non DOM environment. Nothing more than a tree structure, lifecycle hooks, and an escape hatch for committing effects or rendering output. Think of it as the react no runtime of renderers just enough to wire up a mental model without enforcing one. Why this matters long term: It lowers the barrier for innovation in non traditional UIs (terminals, games, generative art, even hardware). It provides a neutral testbed for reconciler behavior outside DOM/Native. It encourages consistency, rather than each library building its own mini React runtime. I don’t think this needs to be a high maintenance package. A well scoped reference with clear boundaries would be enough especially if it’s treated more like a blueprint than a product. I’d be happy to help shape something around this whether that’s prototyping a generic host config, drafting an RFC, or just mapping out the minimal surface area needed to make this viable. There’s a lot of room here for the community to benefit from a shared foundation that doesn’t exist yet and realistically, won’t unless someone builds it with alignment from the core team. |
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