File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -75,3 +75,23 @@ Check out the easy to use documentation and play arround with it.
7575- <a href =" documentation/dropdown.md " >Dropdown</a >
7676- <a href =" documentation/scripts.md " >Scripts</a >
7777
78+
79+ # Usage with React
80+
81+ First, you need to import the ` chocolate.min.css ` file into your ` index.html ` in the ` public/ ` folder.
82+
83+ Now you are able to use the pure css in your React app.
84+
85+ Using scripts is a bit more trickier than the css.
86+
87+ ``` jsx
88+ componentDidMount () {
89+ const script = document .createElement (" script" );
90+ script .src = " /sidebar-toggler.js" ;
91+ document .body .appendChild (script);
92+ }
93+ ```
94+
95+ You can use the ` componentDidMount ` react hook to load the script correctly.
96+ Just implement it into your React component and you are good to go
97+
You can’t perform that action at this time.
0 commit comments