3.0.2 • Published 4 years ago

@team-griffin/react-dye v3.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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);
3.0.2

4 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.0

5 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago