Hi @john john ,
I would recommend you react-add-js-css-ref
. This web part provides an interface to JS and CSS file references so that we don't have to modify code when we need to change references or add new references in the future. As part of security measures, this actions on web part can be only accessed by users who have Manage web permission on site.
Here is the document:
https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-add-js-css-ref
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.