Defining custom css for a class got me confused.
The React-Bootstrap documentation says, you can define a custom non-bootstrap style by using bsClass.
But, here are my doubts:-
how is node environment able to recognize where are the css files located?
You need to add it to your page manually.
One approach (if you use webpack and have css-loader plugin installed, which is by default for react-create-app) is to include your .css file inside a component that needs specific stylesheet:
import './mystylesheet.css'
So your component will look something like this:
import React from 'react'
import { Button } from 'react-bootstrap'
import './mystylesheet.css'
export default function MyCustomButton(props) {
return <Button bsClass="my-custom-class">My button</Button>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With