Skip to content

There is a serious bug about shouldComponentUpdate #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ovaldi opened this issue Nov 27, 2018 · 2 comments
Closed

There is a serious bug about shouldComponentUpdate #47

ovaldi opened this issue Nov 27, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@ovaldi
Copy link
Contributor

ovaldi commented Nov 27, 2018

@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

@markusguenther markusguenther added the bug Something isn't working label Nov 27, 2018
@markusguenther
Copy link
Member

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

@ovaldi
Copy link
Contributor Author

ovaldi commented Nov 28, 2018

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

@ovaldi ovaldi closed this as completed Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants