Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 14, 2022 03:38 pm GMT

Synchronous Rendering

I have a WebGL context that updates on a frame-loop, within a broader React application.

I want to create a second React application to overlay an SVG element above the WebGL context, but critically I need this SVG element to update synchronously in the same frame that the WebGL context renders.

I understand that in most cases asynchronous rendering is a feature not a bug, but in my use-case, I need frame-by-frame integration between the WebGL update cycle and the SVG DOM updates.

It doesn't look like this is possible. flushSync forces updates, but doesn't force rendering. Is there a renderNow or similar function hiding in the React API?

Thanks in advance, Alec


Original Link: https://dev.to/alecmce/synchronous-rendering-3k3a

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To