Skip to content

Commit

Permalink
fix DataProvider not rerendering if initialData prop has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
vladgrecu committed Sep 6, 2024
1 parent d7864ca commit 1b87b9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data-provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const DataProvider = <T, P>(props: DataProviderProps<T, P>) => {
const persistDataDuringLoadingRef = useRef(persistDataDuringLoading);
persistDataDuringLoadingRef.current = persistDataDuringLoading;

useEffect(() => {
setData(initialData);
}, [initialData]);

useEffect(() => {
if (passFetchBecauseWeHaveInitialData.current) {
passFetchBecauseWeHaveInitialData.current = false;
Expand Down

0 comments on commit 1b87b9d

Please sign in to comment.