Please, I am working on a react-typescript project, created using create-react-app, a school project basically, I have two templates to use for admin dashboard and public site, both are jquery based templates with different custom jquery script that triggers owl-carousel and slicknav each, with other jquery functionalities included. Which means I have owl-carousel and slicknav also. If I decide to put the scripts in index.html, there will be conflict in both admin dashboard and public site.
QUESTION
How, how can I isolate those scripts per component, say if a user has logged in and I redirect them to the dashboard, I want to load only the admin dashboard scripts and if he visits the public site, I want to load only the public site scripts.
I tried to add them in folder in src so that I can import them respectively but, I keep getting Uncaught TypeError: $(...).slicknav is not a function
, same thing for owl-carousel and also, am getting another one event is not defined.
Thanks in advance for your help.