File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -42,21 +42,22 @@ import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
4242import { BootstrapButton } from ' react-bootstrap-button' ;
4343
4444const Component = () => {
45- // other code above...
46-
47- const [clicked , setClicked ] = useState (false )
48-
49- const handleClick = () => setClicked (true )
50-
51- < BootstrapButton
52- variant= " danger"
53- className= " m-4"
54- isLoading= {clicked}
55- loadingMessage= " This button is loading..."
56- onClick= {handleClick}
57- >
58- Click me
59- < / BootstrapButton> ;
45+ // other code above...
46+
47+ const [clicked , setClicked ] = useState (false );
48+ const handleClick = () => setClicked (true );
49+
50+ return (
51+ < BootstrapButton
52+ variant= " danger"
53+ className= " m-4"
54+ isLoading= {clicked}
55+ loadingMessage= " This button is loading..."
56+ onClick= {handleClick}
57+ >
58+ Click me
59+ < / BootstrapButton>
60+ );
6061
6162 // other code below...
6263};
@@ -72,13 +73,12 @@ isDisabled?: boolean;
7273spinnerPosition ?: ' left' | ' right' ;
7374spinnerProps ?: SpinnerProps ; // see React Spinner Props Api
7475loadingMessage ?: string ;
75- icon ?: ReactElement ;
76+ leftIcon ?: ReactElement ;
7677```
7778
7879- [ React-Bootstrap Button Props] ( https://react-bootstrap.github.io/components/buttons/#button-props )
7980- [ React-Bootstrap Spinner Props] ( https://react-bootstrap.github.io/components/spinners/#spinner-props )
8081
81-
8282## License
8383
8484MIT Licence
Original file line number Diff line number Diff line change 11{
22 "name" : " react-bootstrap-button" ,
3- "version" : " 1.0.1 " ,
4- "description" : " " ,
3+ "version" : " 1.0.2 " ,
4+ "description" : " This is a quick save for anyone looking to add a loading button for Bootstrap in React. " ,
55 "main" : " dist/cjs/index.js" ,
66 "module" : " dist/esm/index.js" ,
77 "types" : " ./dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments