Steps to create React app and install bootstrap
- Create a React application using the following command:
npx create-react-app class-id
- After creating your project folder(i.e. class-id), move to it by using the following command:
cd class-id
- Now install react-bootstrap in your working directory i.e. class-id by executing the below command in the VScode terminal:
npm install react-bootstrap bootstrap
- Now we need to Add Bootstrap CSS to the index.js file:
import 'bootstrap/dist/css/bootstrap.min.css';
How to Add a classname/id to React-Bootstrap Component ?
In this article, we will learn how we can add a class name and ID to a React-Bootstrap component. ClassName and ID can be used to target elements while styling and scripting (which means writing logic) the application.