Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. export default class App extends Component {
  2.  
  3. constructor(props) {
  4. super(props);
  5.  
  6. this.state = {
  7. dark: false
  8. };
  9.  
  10. this.changeTheme = this.changeTheme.bind(this);
  11. }
  12.  
  13. changeTheme() {
  14. this.setState({ dark: !this.state.dark });
  15. }
  16.  
  17. render() {
  18. return (
  19. <div className={'theme ' + (this.state.dark ? 'theme--dark' : 'theme--default')}>
  20. <div className='base'>
  21. <Router onUpdate={() => window.scrollTo(0, 0)}>
Add Comment
Please, Sign In to add comment