MCPcopy Index your code
hub / github.com/react/react / getSuspenseLineage

Method getSuspenseLineage

packages/react-devtools-shared/src/devtools/store.js:851–866  ·  view source on GitHub ↗
(
    suspenseID: SuspenseNode['id'],
  )

Source from the content-addressed store, hash-verified

849 }
850
851 getSuspenseLineage(
852 suspenseID: SuspenseNode['id'],
853 ): $ReadOnlyArray<SuspenseNode['id']> {
854 const lineage: Array<SuspenseNode['id']> = [];
855 let next: null | SuspenseNode = this.getSuspenseByID(suspenseID);
856 while (next !== null) {
857 if (next.parentID === 0) {
858 next = null;
859 } else {
860 lineage.unshift(next.id);
861 next = this.getSuspenseByID(next.parentID);
862 }
863 }
864
865 return lineage;
866 }
867
868 /**
869 * Like {@link getRootIDForElement} but should be used for traversing Suspense since it works with disconnected nodes.

Callers 2

getInitialStateFunction · 0.80

Calls 1

getSuspenseByIDMethod · 0.95

Tested by

no test coverage detected