I want to install jquery and materialize-css into my React application using npm
, and import it in my React application (I don't want to use CDNs or import in the index.html
file).
Please how do I do that?
I want to install jquery and materialize-css into my React application using npm
, and import it in my React application (I don't want to use CDNs or import in the index.html
file).
Please how do I do that?
You can do this by using a bundler like webpack or browserify. Typically in combination with babel. A quick search gave me this link: https://scotch.io/tutorials/setup-a-react-environment-using-webpack-and-babel.
ES6 -> Webpack -> Babel (ES6/JSX) -> ES5 bundle.
Personally I would use this to import more specialized libraries instead of jQuery but you can definitely do this.