Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/team-griffin/react-dye
https://github.com/team-griffin/react-dye
react theme
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/team-griffin/react-dye
- Owner: team-griffin
- License: mit
- Created: 2017-04-11T21:48:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T21:17:12.000Z (about 2 years ago)
- Last Synced: 2024-10-29T00:59:35.708Z (about 2 months ago)
- Topics: react, theme
- Language: JavaScript
- Size: 3.57 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-dye
```sh
npm i --save @team-griffin/react-dyeyarn 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
```javascript
// A.js
import { ThemeProvider } from '@team-griffin/react-dye';const theme = getYourThemeFromSomewhere(); // Usually this is passed
return (
);// B.js
import { withTheme } from '@team-griffin/react-dye';const MyComponent = (props) => {
);
console.log(props.theme);
return (
};export default withTheme()(MyComponent);
```