FriendsOfReactJS/react-css-themr

There is a serious bug about shouldComponentUpdate

ovaldi opened this issue · 2 comments

@themr('tab', styles)
class Tab extends React.PureComponent {
   ... ...
   render () {
       <div className={ theme.tab } onClick={ this.props.onClick }>
         { this.props.children }
       </div>
    }
}
class Tabs extends React.Component {
  state = {
    text: 'blue'
  }

  handleClick = () => {
     this.setState({
       text: 'gray'
     });
  }

  render () {
     const { text } = this.state;

     return (
       <Tab onClick={ this.handleClick }>
         <Daily text={ text }/>
       </Tab>
     );
  }
}

When I trigger handleClick, the Daily will not update anything, because shouldComponentUpdate always return false in themr.js.
image

@markusguenther

Thanks for reporting this issue ... hope that I`ll find time for that asap. But it would be awesome to receive a PR ;)

@markusguenther i have send a PR, pls check it when you have time, thanks!