Skip to content

hlus/react-native-theme-provider

Repository files navigation

README.md# react-native-theme-provider

Provide provider for use theme in whole application, and use context consumer.

Install

npm install --save react-native-theme-provider

Usage

export default class App extends Component {
  state = {
    currentTheme: themes.default,
  }

  changeTheme = (name: string) => {
    this.setState({ currentTheme: themes[name] })
  }

  render() {
    return (
      <ThemeProvider theme={this.state.currentTheme} changeTheme={this.changeTheme}>
        <EntryPoint />
      </ThemeProvider>  
    )
  }
}

License

MIT © hlus

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published