Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { fetchPresentation } from './presentation.actions';
- import { SpinningWheel } from './spinning-wheel';
- class Menu {
- render() {
- return (
- <button onClick={this.onButtonClick}>
- {this.state.isOpening ? <SpinningWheel /> : 'Open presentation'}
- </button>
- );
- }
- private onButtonClick = async () => {
- this.setState({isOpening: true});
- try {
- await fetchPresentation();
- }
- finally {
- this.setState({isOpening: false});
- }
- }
- }
Add Comment
Please, Sign In to add comment