reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Redraw and nextProps #22

Closed bultas closed 9 years ago

bultas commented 9 years ago

In my opinion, should be in Core.js/componentWillReceiveProps nextProps.redraw instead of this.props.redraw, With nextProps.redraw you enable to choose how user want draw the chart in next update cycle (redraw:false with new metrics or redraw:true with new labels,..). But with this.props.redraw you can affect only second update cycle, which is not so flexible and you can not redraw chart instantly when you need it.

Is there some point why it has to be this.props.redraw or can I create pull request?

jhudson8 commented 9 years ago

sounds like a better approach. feel free to create a PR. Thanks

ghost commented 9 years ago

Thanks a lot bultas! I was having this weird bug where the chart redraws only in the second update.