Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import javascript min file in my component?

I'm working on the react project. I created project with create-react-app. I need to import 'js-sequence-diagram' javascript file in my component. How can I import javascript min file in my component?

what I want to do is: https://github.com/zfanta/react-sequence-diagram

where "index.js" file "sequence-diagram-2.0.1.js" file was used. But I could not use it like that.

like image 849
yunusunver Avatar asked Feb 03 '26 19:02

yunusunver


1 Answers

1- install it first using

npm install react-sequence-diagram

2- then just put import SequenceDiagram from 'react-sequence-diagram; where ever you want to use the component

like image 128
yekanchi Avatar answered Feb 06 '26 09:02

yekanchi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!