How to use the react-with-direction/dist/constants.DIRECTIONS.RTL 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 / deprecated / withStyles.jsx View on Github external
// and if the theme used to create them corresponds to the theme
    // registered with ThemedStyleSheet
    if (styleDef && currentTheme === registeredTheme) {
      return styleDef;
    }

    if (
      process.env.NODE_ENV !== 'production'
      && typeof performance !== 'undefined'
      && performance.mark !== undefined && typeof performance.clearMarks === 'function'
    ) {
      performance.clearMarks(START_MARK);
      performance.mark(START_MARK);
    }

    const isRTL = direction === DIRECTIONS.RTL;

    if (isRTL) {
      styleDefRTL = styleFn
        ? ThemedStyleSheet.createRTL(styleFn)
        : EMPTY_STYLES_FN;

      currentThemeRTL = registeredTheme;
      styleDef = styleDefRTL;
    } else {
      styleDefLTR = styleFn
        ? ThemedStyleSheet.createLTR(styleFn)
        : EMPTY_STYLES_FN;

      currentThemeLTR = registeredTheme;
      styleDef = styleDefLTR;
    }