For reasons too long to explain here (and not very relevant) I want to be able to circumvent React's render batching and force a component tree to be immediately rendered in some DOM element, even if it means a forced layout and a slowdown of the application.
I don't need any listeners bound - I just need to measure the dimensions of the rendered component and then remove it from the DOM.
The only solution I can think of is rendering to string and setting the innerHTML of the container, but the renderToString
method is only available on react-dom/server
and by looking in the code it seems that it changes the batching strategy globally in the entire React library.
Any ideas?