erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12k stars 2.5k forks source link

How to use setState for local display change #1280

Closed pengzhanlee closed 8 years ago

pengzhanlee commented 8 years ago

Hi, all

I dont't want to dispatch an action, it's just a display state for UI Component.

I tried to use setState, and return true in shouldComponentUpdate, but it not work.

<SomeComponent onClick={()=>{ this.setState({ showAnthorComponent: true }); }) }} />

<AnthorComponent show={this.props.showAnthorComponent} />

pengzhanlee commented 8 years ago

I found an example in about.js.