How to use the react-fela.connect function in react-fela

To help you get started, we’ve selected a few react-fela 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 root-systems / dogstack / examples / dogs / dogs / components / dogs.js View on Github external
Adopt a dog!
      
      <button> {
          const randomDogId = keys(dogs)[random(keys(dogs).length - 1)]
          removeDog(randomDogId)
        }}
      &gt;
        Give a dog to a friend!
      </button>
    
  }
}

export default connectFela(
  gcs(styles)
)(Dogs)
github simonsmith / github-user-search / src / components / Stats / Stats.js View on Github external
marginRight: '28px',
    display: 'flex',
    flexDirection: 'column',
    alignItems: 'center',
  }),

  Stats_value: () => ({
    fontSize: '30px',
  }),

  Stats_label: () => ({
    fontSize: '14px',
  }),
};

export default connect(styles)(Stats);
github simonsmith / github-user-search / src / components / SearchResults / SearchResults.js View on Github external
[MQ]: {
      display: 'flex',
      flexWrap: 'wrap',
    },
  }),

  SearchResults_item: () => ({
    marginBottom: '15px',

    [MQ]: {
      flexBasis: 'calc(100% / 3)',
    },
  }),
};

export default connect(styles)(SearchResults);
github cloudflare / cf-ui / packages / cf-style-container / src / index.js View on Github external
const createComponentStyles = (styleFunctions, component) =>
  connect(styleFunctions)(component);
github cdmbase / fullstack-pro / packages-modules / counter / browser / src / fela / components / ComplexComponent.tsx View on Github external
},
    firstSection: ({ theme }) => ({
        backgroundColor: theme.color.primary,
        fontSize: `{5 * fontScale}px`,
    }),
    secondSection: {
        backgroundColor: theme.color.secondary,
        fontSize: `${7 * fontScale}px`,
    },
    thirdSection: {
        backgroundColor: theme.color.additional,
        fontSize: `${10 * fontScale}px`,
    },
});

export const Complex = connect(complexComponentStyle)(ComplexComponent);
github microsoft / fluent-ui-react / src / lib / createComponent.tsx View on Github external
const createComponent = (Component, config: any = {}): any =&gt; {
  const displayName = Component.name || Component.displayName
  const { rules, variables, shorthand } = config
  const StyledComponent = rules ? connect(rules)(Component) : Component

  const UIComponent: any = props =&gt; (
     {
        const variablesFromFile = callable(variables)(siteVariables)
        const variablesFromTheme = callable(componentVariables[displayName])(siteVariables)
        const variablesFromProp = callable(props.variables)(siteVariables)

        const mergedVariables = Object.assign(
          {},
          variablesFromFile,
          variablesFromTheme,
          variablesFromProp,
        )

        return
github MicheleBertoli / css-in-js / react-fela / button.js View on Github external
},
  ':active': {
    position: 'relative',
    top: '2px'
  },
  '@media (max-width: 480px)': {
    width: '160px'
  }
});

const mapStylesToProps = props =&gt; renderer =&gt; ({
  container: renderer.renderRule(container),
  button: renderer.renderRule(button)
})

const Button = connect(mapStylesToProps)(({ styles }) =&gt; (
  <div>
    <button>Click me!</button>
  </div>
));

const renderer = createRenderer();
const mountNode = document.getElementById('stylesheet');

render(
  
    <button>
  ,
  document.getElementById('content')
);
</button>