Hacker News new | ask | show | jobs
by mhenr18 2235 days ago
I work on an app that edits and renders fairly complex indoor floorplans to SVG, all using React.

We deal with large hospitals and airports, so it's normal for us to have tens of thousands of components mounted at once - pagination isn't a viable solution for our purposes.

We've had to tap basically every optimization that React apps can do when managing large numbers of elements - however this has been worth it for us:

- We can use the same code to render interactive plans on the client, and to render to print-quality PDFs on the server - We can use the same framework in our UI and plan rendering

The downside is that it's more CPU intensive than alternatives like a WebGL renderer, but for now that's a tradeoff worth making.

1 comments

> more CPU intensive than alternatives like a WebGL renderer, but for now that's a tradeoff worth making

Mixing traditional React with WebGL is another option. There's react-three-fiber[1], and custom/simpler hybrids are also possible. Though I've not tried server-side rendering.

[1] https://github.com/react-spring/react-three-fiber