grapher-react
grapher-react copied to clipboard
When query params are updated new and old data is mixed up in withStaticQuery
I noticed a bug in withStaticQuery where if you update the query without remounting the component it will still fetch old data and will alternate between new and old data which causes all sorts of problems.
I think it's related to these lines:
https://github.com/cult-of-coders/grapher-react/blob/0d7e8c3795927d9306743f136dad8954aa7d6fe4/lib/withStaticQuery.js#L16-L30
In componentWillReceiveProps interval should be reset and started with a new query from props.