'Why does ReactDOMServer.renderToStaticMarkup not work after upgrading to Android 11 (SDK 30)?

I am working on an android application and as of November, google requires we target SDK 30.

While upgrading from 29 -> 30, the ReactDOMServer.renderToStaticMarkup functionality seems to have broken. While debugging, during the 'finally' clause while destroying the renderer, the application consistently crashes. If I downgrade to SDK version 29, everything works as expected but this is not a viable solution. I am working with react 17.0.2 and react-dom 17.0.2.

Any insight into this problem would be appreciated, thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source