Open Sergeeeek opened 6 years ago
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.
withStaticQuery
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.
componentWillReceiveProps
query
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 newquery
from props.