Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ButtonWithLoading extends React.Component {
- render() {
- const { isLoading } = this.props;
- return (
- <Button onClick={ onButtonClick }>
- {
- isLoading && <CircularProgress />
- }
- </Button>
- );
- }
- }
- class HOC extends React.Component {
- render() {
- const { isLoading } = this.props;
- return <ButtonWithLoading { ...{ isLoading } } />;
- }
- }
- export default connect(({ documents }) => ({
- isLoading: documents.isLoading,
- documents: documents.data
- }))(HOC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement