MCPcopy Create free account
hub / github.com/BetaSu/big-react / hideOrUnhideAllChildren

Function hideOrUnhideAllChildren

packages/react-reconciler/src/commitWork.ts:169–180  ·  view source on GitHub ↗
(finishedWork: FiberNode, isHidden: boolean)

Source from the content-addressed store, hash-verified

167}
168
169function hideOrUnhideAllChildren(finishedWork: FiberNode, isHidden: boolean) {
170 findHostSubtreeRoot(finishedWork, (hostRoot) => {
171 const instance = hostRoot.stateNode;
172 if (hostRoot.tag === HostComponent) {
173 isHidden ? hideInstance(instance) : unhideInstance(instance);
174 } else if (hostRoot.tag === HostText) {
175 isHidden
176 ? hideTextInstance(instance)
177 : unhideTextInstance(instance, hostRoot.memoizedProps.content);
178 }
179 });
180}
181
182function safelyDetachRef(current: FiberNode) {
183 const ref = current.ref;

Callers 1

Calls 5

hideInstanceFunction · 0.90
unhideInstanceFunction · 0.90
hideTextInstanceFunction · 0.90
unhideTextInstanceFunction · 0.90
findHostSubtreeRootFunction · 0.85

Tested by

no test coverage detected