DEV Community

Discussion on: Dynamically Appending a script tag in a React App

Collapse
 
malkebulan profile image
Mensah Alkebu-Lan • Edited

I'm not sure initializing useRef with null will work. You may get a compilation error.

Object is possibly 'null'. TS2531

May have to do some kind of null check or something, but the theory is sound. Thanks for sharing.