@team-griffin/react-dye

3.0.2 • Public • Published

react-dye

npm i --save @team-griffin/react-dye

yarn add @team-griffin/react-dye

This package was created as I was fustrated with the existing theming options for react which all use context or try and resolve the styles for you.

This package uses react-broadcast to avoid the sCU problem.

Note: We do not recommend using this on every component that you need to have the theme object. This is for those edge cases where you can not pass props down the tree any further due to something blocking it (like react-router v3).

Usage

// A.js
import { ThemeProvider } from '@team-griffin/react-dye';

const theme = getYourThemeFromSomewhere(); // Usually this is passed

return (
  <ThemeProvider theme={theme}>
    <MyComponentTree/>
  </ThemeProvider>
);

// B.js
import { withTheme } from '@team-griffin/react-dye';

const MyComponent = (props) => {
  console.log(props.theme);
  return (<div/>);
};

export default withTheme()(MyComponent);

Readme

Keywords

none

Package Sidebar

Install

npm i @team-griffin/react-dye

Weekly Downloads

2

Version

3.0.2

License

MIT

Unpacked Size

12 kB

Total Files

20

Last publish

Collaborators

  • christierobson
  • jackmellis
  • jshthornton
  • quagliero