NetSuite performs static analysis on client scripts when you create a client script or attach one to a suitelet. Since the server JS engine hasn't been updated for the better part of a decade, it bombs out when libraries like React use newer apis like WeakMap.
As a result your client script needs to dynamically import react / react-dom to call ReactDOM.render