mirror of
https://github.com/bendtherules/react-fiber-traverse.git
synced 2026-08-18 13:52:36 +00:00
Rename findNodeByComponentInstance to findNodeByComponentRef
This commit is contained in:
+4
-4
@@ -57,7 +57,7 @@ function findNodeByComponent(
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function findNodeByComponentInstance(
|
function findNodeByComponentRef(
|
||||||
node: FiberNode | null,
|
node: FiberNode | null,
|
||||||
expectedClassInstance: React.Component
|
expectedClassInstance: React.Component
|
||||||
): FiberNode | null {
|
): FiberNode | null {
|
||||||
@@ -70,13 +70,13 @@ function findNodeByComponentInstance(
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const returnVal = findNodeByComponentInstance(node.child, expectedClassInstance);
|
const returnVal = findNodeByComponentRef(node.child, expectedClassInstance);
|
||||||
if (returnVal !== null) {
|
if (returnVal !== null) {
|
||||||
return returnVal;
|
return returnVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const returnVal = findNodeByComponentInstance(node.sibling, expectedClassInstance);
|
const returnVal = findNodeByComponentRef(node.sibling, expectedClassInstance);
|
||||||
if (returnVal !== null) {
|
if (returnVal !== null) {
|
||||||
return returnVal;
|
return returnVal;
|
||||||
}
|
}
|
||||||
@@ -85,4 +85,4 @@ function findNodeByComponentInstance(
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { findNodeByComponentName, findNodeByComponent, findNodeByComponentInstance };
|
export { findNodeByComponentName, findNodeByComponent, findNodeByComponentRef };
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
import traverse from "./traverse";
|
import traverse from "./traverse";
|
||||||
import {
|
import {
|
||||||
findNodeByComponent,
|
findNodeByComponent,
|
||||||
findNodeByComponentInstance,
|
findNodeByComponentRef,
|
||||||
findNodeByComponentName
|
findNodeByComponentName
|
||||||
} from "./findNode";
|
} from "./findNode";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
traverse,
|
traverse,
|
||||||
findNodeByComponent,
|
findNodeByComponent,
|
||||||
findNodeByComponentInstance,
|
findNodeByComponentRef,
|
||||||
findNodeByComponentName
|
findNodeByComponentName
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user