How to export ReactJS + Typescript component for Vanilla JS and HTML

19 Views Asked by At

I have one of ReactJS component and its sub-components styled with css. I would you like to export my component for VanillaJS and HTML. Is there any easier way for it ?

I don't want to import react@17 or 18 into HTML.

Or I am open for any other suggestions instead of ReactJS

I tried to run "react-scripts eject" it wouldn't work.

1

There are 1 best solutions below

0
ibrahimtuna On

I found solution with below steps

run npm run build

after than, you will get build folder into your project directory. Copy main.XXXX.js file and import it to HTML via script tag. Do same thing for your css file.