Skip to content

Commit 000f713

Browse files
Apply suggestions from code review
`allChildren.length === 1` Co-authored-by: Copilot <[email protected]>
1 parent c6d9c9d commit 000f713

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/lib/src/childQueries/findChild/findChild.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const findChild = (
5050

5151
// Since we don't recurse into nested fragments,
5252
// we can unwrap the top-level fragment if it's the only child
53-
if (Children.count(allChildren) === 1) {
53+
if (allChildren.length === 1) {
5454
const child = allChildren[0];
5555

5656
if (isValidElement(child) && child.type === Fragment) {

packages/lib/src/childQueries/findChildren/findChildren.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const findChildren = (
2121
// Since we don't recurse into nested fragments,
2222
// we can unwrap the top-level fragment if it's the only child
2323
// and search its children directly
24-
if (Children.count(allChildren) === 1) {
24+
if (allChildren.length === 1) {
2525
const child = allChildren[0];
2626

2727
if (isValidElement(child) && child.type === Fragment) {

0 commit comments

Comments
 (0)