diff --git a/package.json b/package.json index febda7f..59df4f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-done-tracker", - "version": "0.0.12", + "version": "0.0.13", "description": "Keep track of when your React tree is done loading", "type": "module", "main": "./dist/index.js", diff --git a/src/components/TrackDone.tsx b/src/components/TrackDone.tsx index e546cc0..85c3aec 100644 --- a/src/components/TrackDone.tsx +++ b/src/components/TrackDone.tsx @@ -72,6 +72,7 @@ export function ForkedTrackDone({ export function TrackDone({ children, + forceRoot = false, forceRefreshRef, doneTrackerName = "Root", onDone, @@ -79,12 +80,13 @@ export function TrackDone({ onPending, }: TrackComponentDoneProps<{ children: any; + forceRoot: boolean; forceRefreshRef?: MutableRefObject<(() => void) | null>; doneTrackerName?: string; }>) { const hasDoneTrackerParent = !!useContext(DoneTrackerContext); - if (hasDoneTrackerParent) { + if (hasDoneTrackerParent && !forceRoot) { return (