Skip to content

Commit

Permalink
Add forceRoot to track done
Browse files Browse the repository at this point in the history
  • Loading branch information
hansottowirtz committed Sep 21, 2023
1 parent bfa7181 commit c1eb162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/components/TrackDone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,21 @@ export function ForkedTrackDone({

export function TrackDone({
children,
forceRoot = false,
forceRefreshRef,
doneTrackerName = "Root",
onDone,
onError,
onPending,
}: TrackComponentDoneProps<{
children: any;
forceRoot: boolean;
forceRefreshRef?: MutableRefObject<(() => void) | null>;
doneTrackerName?: string;
}>) {
const hasDoneTrackerParent = !!useContext(DoneTrackerContext);

if (hasDoneTrackerParent) {
if (hasDoneTrackerParent && !forceRoot) {
return (
<ForkedTrackDone
name={doneTrackerName}
Expand Down

0 comments on commit c1eb162

Please sign in to comment.