How to use the recompose/compose function in recompose

To help you get started, we’ve selected a few recompose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TEAM-OSTRICH / SYS-DIFFER / src / client / containers / MainContainer.jsx View on Github external
handleSelect={handleSelect}
                selectAll={selectAll}
              />
            )
            : null}
          {/* {scriptDisplay ?  : null} */}
          {/* {saveLoadDisplay ?  : null} */}
      
    );
    /* eslint-enable */
  }
}


// export default withRouter(MainContainer);
export default compose(
  withRouter,
  withStyles(),
)(MainContainer);
github withspectrum / spectrum / src / components / profile / user.js View on Github external
initMessage()}
                tipText={`Message ${user.name}`}
                tipLocation={'top-left'}
              />
            )}
          
        
      );
  }
};

const User = compose(
  displayLoadingCard,
  withRouter,
  withCurrentUser
)(UserWithData);
const mapStateToProps = state => ({
  initNewThreadWithUser: state.directMessageThreads.initNewThreadWithUser,
});
// $FlowFixMe
export default connect(mapStateToProps)(User);
github istarkov / google-map-clustering-example / src / markers / ClusterMarker.js View on Github external
style={{
          transform: `translate3D(0,0,0) scale(${scale}, ${scale})`,
        }}
      >
        <div>
          {text}
        </div>
      
    )
  }
  
);

export const clusterMarkerHOC = compose(
  defaultProps({
    text: '0',
    styles: clusterMarkerStyles,
    initialScale: 0.6,
    defaultScale: 1,
    hoveredScale: 1.15,
    hovered: false,
    stiffness: 320,
    damping: 7,
    precision: 0.001,
  }),
  // pure optimization can cause some effects you don't want,
  // don't use it in development for markers
  pure,
  withPropsOnChange(
    ['initialScale'],
github MCS-Lite / mcs-lite-app / client / app / components / devices / index.js View on Github external
pushToast={pushToast}
              uploadDeviceImage={uploadDeviceImage}
            /&gt;
          )) : <div>
            
          </div>
        }
      
    
  
);

export default compose(
  pure,
  withState('filterKey', 'setFilterKey', ''),
)(Devices);
github rsuite / rsuite / src / InputGroup.js View on Github external
return (
      
        <div>
          {disabled ? this.disabledChildren() : children}
        </div>
      
    );
  }
}

const EnhancedInputGroup = compose(
  withStyleProps({
    hasSize: true
  }),
  defaultProps({
    classPrefix: 'input-group'
  })
)(InputGroup);

setStatic('Addon', InputGroupAddon)(EnhancedInputGroup);
setStatic('Button', InputGroupButton)(EnhancedInputGroup);

export default EnhancedInputGroup;
github withspectrum / spectrum / mobile / components / ThreadComposer / components / LocationPicker.js View on Github external
style={{ marginRight: 8, marginVertical: 8 }}
      /&gt;
      <select value="{selected.channel}" placeholder="{{">
          onSelectedChange({ community: selected.community, channel: value })
        }
        style={{ marginVertical: 8 }}
      /&gt;
    
  );
};

export default compose(
  ViewNetworkHandler,
  getComposerCommunitiesAndChannels
)(LocationPicker);
</select>
github withspectrum / spectrum / mobile / views / Thread / components / CommunityHeader.js View on Github external
navigation.navigate({
                routeName: `Channel`,
                key: channel.id,
                params: { id: channel.id },
              })
            }
          &gt;
            {channel.name}
          
        )}
      
    );
  }
}

export default compose(withNavigation)(CommunityHeader);
github dhis2 / d2-ui / packages / sharing-dialog / src / Access.component.js View on Github external
accessType: PropTypes.string.isRequired,
    accessOptions: PropTypes.object.isRequired,
    primaryText: PropTypes.string.isRequired,
    onChange: PropTypes.func.isRequired,
    disabled: PropTypes.bool,
    secondaryText: PropTypes.string,
    onRemove: PropTypes.func,
};

Access.defaultProps = {
    secondaryText: undefined,
    onRemove: undefined,
    disabled: false,
};

export const GroupAccess = compose(
    mapProps(useAccessObjectFormat),
    withProps(props => ({
        accessType: props.groupType,
        primaryText: props.groupName,
        accessOptions: {
            meta: { canView: true, canEdit: true, noAccess: false },
            data: props.dataShareable && {
                canView: true,
                canEdit: true,
                noAccess: true,
            },
        },
    }))
)(Access);

export const ExternalAccess = compose(
github withspectrum / spectrum / mobile / components / Toasts / index.js View on Github external
);
  }
}

const map = (state: ReduxState): * =&gt; ({ toasts: state.toasts });
export default compose(
  connect(map),
  withTheme
)(Toasts);
github bootstrap-styled / ra-ui / examples / demo / src / Login.js View on Github external
);
    }
}

Login.propTypes = {
    ...propTypes,
    authProvider: PropTypes.func,
    previousRoute: PropTypes.string,
    translate: PropTypes.func.isRequired,
    userLogin: PropTypes.func.isRequired,
};

const mapStateToProps = state =&gt; ({ isLoading: state.admin.loading &gt; 0 });

const enhance = compose(
    translate,
    reduxForm({
        form: 'signIn',
        validate: (values, props) =&gt; {
            const errors = {};
            const { translate } = props;
            if (!values.username) {
                errors.username = translate('ra.validation.required');
            }
            if (!values.password) {
                errors.password = translate('ra.validation.required');
            }
            return errors;
        },
    }),
    connect(