-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure the skeleton placeholder remains visible when the parent scree…
…n’s state changes; Implement logic to reset the skeleton internally whenever the children change.
- Loading branch information
Henrique Ramos
committed
Feb 12, 2025
1 parent
a123dd8
commit 3ab4706
Showing
3 changed files
with
94 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import {ViewProps} from 'react-native-svg/lib/typescript/fabric/utils'; | ||
|
||
const flatten = (children: React.ReactElement<ViewProps>, acc: any[] = []) => { | ||
acc = [...acc, ...React.Children.toArray(children)]; | ||
|
||
if (children.props && children.props.children) | ||
return flatten(children.props.children as React.ReactElement<ViewProps>, acc); | ||
|
||
return acc; | ||
}; | ||
|
||
export default flatten; |