Skip to content

There is a serious bug about shouldComponentUpdate #47

Closed
@ovaldi

Description

@ovaldi
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions