2.1.3 • Published 4 years ago

@svkeg/re-theme v2.1.3

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

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.