react bootstrap do you need to import 1

react bootstrap do you need to import

//1.run following commnad in cmd:
npm install bootstrap --save
//you can now use bootstrap component. example:
import { Button } from 'react-bootstrap';

//2.or  add this to index.js:

Here is what the above code is Doing:
1. We are importing the Button component from the react-bootstrap package.
2. We are using the Button component to render a button.
3. We are passing the text “Click Me” as a prop to the Button component.
4. We are passing the onClick prop to the Button component.
5. We are passing the handleClick function as the value of the onClick prop.
6. We are using the handleClick function to update the state of the App component.
7. We are using the count property of the state to display the number of times the button has been clicked.

Similar Posts