@svkeg/re-theme

2.1.3 • Public • Published

ReTheme

Simple React and React Native Theme builder / switcher

Setup

Add to your package.json

  "re-theme": "git+https://github.com/simpleviewinc/re-theme"

Example

import { ReThemeProvider } from 're-theme'

const myCustomTheme = {
  // theme styles go here
}

export const App from Component {
  
  state = { theme: myCustomTheme }
  
  componentDidUpdate = () => {
    this.props.theme !== this.state.theme &&
      this.setState({ theme: this.props.theme })
  }
  
  render(){
    return  (
      <ReThemeProvider theme={theme} merge={false} >
        <App />
      </ReThemeProvider>
    )
  }

}

API

Checkout the Example App for documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i @svkeg/re-theme

Weekly Downloads

1

Version

2.1.3

License

MIT

Unpacked Size

101 kB

Total Files

8

Last publish

Collaborators

  • lktipton