Closed Matthew-Mallimo closed 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit cf4e46218952219670dafc7e696b65cf8816eacd:
Sandbox | Source |
---|---|
quick-install | Configuration |
fetchye-provider-install | Configuration |
fetchye-redux-provider-install | Configuration |
nextjs-fetchye-ssr | Configuration |
Description
The dependency array for the useEffect in
makeUseFetchyeSelector
included a functional reference that was only updated when thekey
changes. In certain circumstances where data fetching is started by another process (not useFetchye), this useEffect would fail to run once the data was returned.Implementing this actually reduced the number of renders.
Motivation and Context
This change correctly reruns the useEffect when data has changed.
How Has This Been Tested?
Unit tests, and manual testing.
Types of Changes
Checklist:
What is the Impact to Developers Using Fetchye?