I’m developing a React application that needs to render a large number of elements. I’ve implemented the rendering using both and .
Canvas: Provides excellent performance and smooth rendering.
SVG: Offers superior style and design capabilities with sharpness, but it lags in performance, resulting in some rendering lag.
I have already implemented several strategies to optimize rendering, such as:
Rendering elements only within the viewport.
Using useMemo to memoize static data.
My question is: How can I achieve the design and styling benefits of SVG while maintaining the high performance and smoothness of Canvas? Are there any advanced techniques or best practices that can help me bridge this gap?
Thank you for your assistance!
I tried to use a lot of basic method to achieve sharpness of SVG with canvas, but in final the SVG can’t be replaced.
6