Closed oncomouse closed 6 years ago
Hey @oncomouse, thanks for the PR 👍 Do you have any sample code to reproduce the issue I can try out?
Can we accept this pull request? It does appear to fix our issue.
I somehow missed @ankane's initial comment. Here's a repo that produces the initial issue for me: https://github.com/oncomouse/react-chartkick-example
Hey @oncomouse and @Sexual, can you try the master
branch? After reading the React docs, I think componentDidUpdate
is the correct hook we want to use.
@ankane, the master
branch seems to fix this issue. 👍
Great, thanks for confirming. Just pushed a new release.
This is a possible solution to the problem in #12
The "Loading…" message that appears seems to be hanging around from earlier loads. As the actual React component (rather than the Chartkick object) only needs to update when
props.id
changes, creating the new Chartkick object inshouldComponentUpdate
instead ofcomponentWillUpdate
prevents the erroneous loading message from appearing.