How to use react-lifecycles-compat - 10 common examples

To help you get started, we’ve selected a few react-lifecycles-compat 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 react-component / scroll-anim / src / index.js View on Github external
// export this package's api
import { polyfill } from 'react-lifecycles-compat';
import ScrollOverPack from './ScrollOverPack';
import ScrollParallax from './ScrollParallax';
import ScrollLink from './ScrollLink';
import ScrollElement from './ScrollElement';
import ScrollEvent from './EventDispatcher';
import Screen from './ScrollScreen';

export const OverPack = polyfill(ScrollOverPack);
export const Parallax = polyfill(ScrollParallax);
export const Element = polyfill(ScrollElement);
export const Link = ScrollLink;
export const Event = ScrollEvent;
export const scrollScreen = Screen;

export default {
  OverPack,
  Parallax,
  Element,
  Link,
  Event,
  scrollScreen,
};
github benwiley4000 / react-gif-player / src / index.js View on Github external
// extract these props but pass down the rest
    const { autoplay, pauseRef, onTogglePlay, ...rest } = this.props;
    const { actualGif, actualStill, playing } = this.state;
    return (
       this.toggle()}
      />
    );
  }
}

lifecyclesPoylfill(GifPlayerContainer);

GifPlayerContainer.propTypes = {
  gif: PropTypes.string,
  still: PropTypes.string,
  autoplay: PropTypes.bool,
  pauseRef: PropTypes.func,
  onTogglePlay: PropTypes.func
};

export default GifPlayerContainer;
github iuap-design / bee.tinper.org / tinper-bee / bee-datepicker / src / rc-calendar / RangeCalendar.js View on Github external
{...props}
                    onOk={this.onOk}
                    okDisabled={!this.isAllowedDateAndTime(selectedValue) ||
                      !this.hasSelectedValue() || hoverValue.length
                    }
                  /> : null}
              
            ) : null}
          
        
      
    );
  }
}

polyfill(RangeCalendar);

export default commonMixinWrapper(RangeCalendar);
github salt-ui / saltui / src / TabBar / TabBar.jsx View on Github external
const style = {};
    if (this.state.centerMoreVisible) {
      style.zIndex = 1010;
    }
    return (
      <div style="{style}">
        {t.renderItems()}
      </div>
    );
  }
}

TabBar.Item = TabBarItem;
TabBar.Item2 = TabBarItemCenter;

polyfill(TabBar);

export default TabBar;
github NSFI / ppfish-components / source / components / Tree / DirectoryTree.tsx View on Github external
ref={(node: Tree) => this.tree = node}
        {...props}
        prefixCls={prefixCls}
        className={connectClassName}
        expandedKeys={expandedKeys}
        selectedKeys={selectedKeys}
        onSelect={this.onSelect}
        onClick={this.onClick}
        onDoubleClick={this.onDoubleClick}
        onExpand={this.onExpand}
      />
    );
  }
}

polyfill(DirectoryTree);

export default DirectoryTree;
github wojtekmaj / react-time-picker / src / TimePicker.jsx View on Github external
name: PropTypes.string,
  nativeInputAriaLabel: PropTypes.string,
  onChange: PropTypes.func,
  onClockClose: PropTypes.func,
  onClockOpen: PropTypes.func,
  onFocus: PropTypes.func,
  required: PropTypes.bool,
  secondAriaLabel: PropTypes.string,
  secondPlaceholder: PropTypes.string,
  value: PropTypes.oneOfType([
    isValue,
    PropTypes.arrayOf(isValue),
  ]),
};

polyfill(TimePicker);
github NSFI / ppfish-components / es / components / Cascader / index.js View on Github external
Cascader.defaultProps = {
    prefixCls: 'fishd-cascader',
    inputPrefixCls: 'fishd-input',
    placeholder: '请选择',
    transitionName: 'slide-up',
    popupPlacement: 'bottomLeft',
    options: [],
    disabled: false,
    allowClear: true,
    notFoundContent: '无匹配结果'
  };
  return Cascader;
}(React.Component);

polyfill(Cascader);
export default Cascader;
github ant-design / ant-design / components / upload / Upload.tsx View on Github external
}

    return (
      <span>
        {uploadButton}
        {uploadList}
      </span>
    );
  };

  render() {
    return {this.renderUpload};
  }
}

polyfill(Upload);

export default Upload;
github sikidamjanovic / cowrite / node_modules / antd / es / button / button.js View on Github external
block: false,
  htmlType: 'button'
};
Button.propTypes = {
  type: PropTypes.string,
  shape: PropTypes.oneOf(ButtonShapes),
  size: PropTypes.oneOf(ButtonSizes),
  htmlType: PropTypes.oneOf(ButtonHTMLTypes),
  onClick: PropTypes.func,
  loading: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
  className: PropTypes.string,
  icon: PropTypes.string,
  block: PropTypes.bool,
  title: PropTypes.string
};
polyfill(Button);
export default Button;
//# sourceMappingURL=button.js.map
github storybookjs / storybook / lib / ui / src / modules / ui / components / search_box.js View on Github external
);
  }
}

SearchBox.defaultProps = { stories: [] };

SearchBox.propTypes = {
  theme: PropTypes.shape({}).isRequired,
  showSearchBox: PropTypes.bool.isRequired,
  stories: PropTypes.arrayOf(PropTypes.object),
  onSelectStory: PropTypes.func.isRequired,
  onClose: PropTypes.func.isRequired,
};

export { SearchBox };
polyfill(SearchBox);
export default withTheme(props =&gt; );

react-lifecycles-compat

Backwards compatibility polyfill for React class components

MIT
Latest version published 6 years ago

Package Health Score

72 / 100
Full package analysis

Popular react-lifecycles-compat functions

Similar packages