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';
42
42
import { BootstrapButton } from ' react-bootstrap-button' ;
43
43
44
44
const 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
+ );
60
61
61
62
// other code below...
62
63
};
@@ -72,13 +73,12 @@ isDisabled?: boolean;
72
73
spinnerPosition ?: ' left' | ' right' ;
73
74
spinnerProps ?: SpinnerProps ; // see React Spinner Props Api
74
75
loadingMessage ?: string ;
75
- icon ?: ReactElement ;
76
+ leftIcon ?: ReactElement ;
76
77
```
77
78
78
79
- [ React-Bootstrap Button Props] ( https://react-bootstrap.github.io/components/buttons/#button-props )
79
80
- [ React-Bootstrap Spinner Props] ( https://react-bootstrap.github.io/components/spinners/#spinner-props )
80
81
81
-
82
82
## License
83
83
84
84
MIT Licence
Original file line number Diff line number Diff line change 1
1
{
2
2
"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. " ,
5
5
"main" : " dist/cjs/index.js" ,
6
6
"module" : " dist/esm/index.js" ,
7
7
"types" : " ./dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments