I'm trying to utilize a jquery library called select2 in my React app created by create-react-app.
I have added jquery and select2 to my package.json and I can make the javascript work.
However, the styling does not work as the css file of select 2 is not included correctly.
I can see the following file inside my project:
node_modules/select2/dist/css/select2.min.css
and of course I can copy the file into public/css and add this to my index.html:
<link href="css/select2.min.css" rel="stylesheet">
I'm sure there is a better way utilizing the power of webpack and the create-react-app toolchain. But how?
I often just require the css in the index of my app.
index.js:
require('node_modules/select2/dist/css/select2.min.css')