How to use the react-with-direction function in react-with-direction

To help you get started, we’ve selected a few react-with-direction 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 airbnb / react-with-styles / src / contextual / withStyles.jsx View on Github external
return (
        
      );
    }

    // Listen to directional updates via props
    // eslint-disable-next-line no-func-assign
    WithStyles = withDirection(WithStyles);

    // Make into a pure functional component if requested
    // eslint-disable-next-line no-func-assign
    WithStyles = pureComponent ? memo(WithStyles) : WithStyles;

    // Set React statics on WithStyles
    WithStyles.WrappedComponent = WrappedComponent;
    WithStyles.displayName = `withStyles(${wrappedComponentName})`;
    if (WrappedComponent.propTypes) {
      WithStyles.propTypes = { ...WrappedComponent.propTypes };
      delete WithStyles.propTypes[stylesPropName];
      delete WithStyles.propTypes[themePropName];
      delete WithStyles.propTypes[cssPropName];
    }
    if (WrappedComponent.defaultProps) {
      WithStyles.defaultProps = { ...WrappedComponent.defaultProps };

react-with-direction

Components to provide and consume RTL or LTR direction in React

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis

Similar packages