Closed
Description
@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.