How to use react-bootstrap in typescript project
This error usually occurs when the node module is not found or possibly incorrectly installed. So in the case that it is not found or available run the following command npm i react-bootstrap
and then make sure it is in your package.json listed under dependencies.
If this still doesn't work delete the package-lock.json
file and run npm i
to install all the packages again. Make sure react-bootstrap is in dependencies before doing so otherwise do npm i react-bootstrap
first then npm i
In my case, I just added this line to my index.tsx and after that works just fine:
import 'bootstrap/dist/css/bootstrap.min.css';
but before that you need to install the libraries, using this command:npm i react-bootstrap bootstrap