react-native-skeleton-placeholder
react-native-skeleton-placeholder copied to clipboard
Add children type to SkeletonPlaceholderItemProps to prevent warnings when nesting SkeletonPlaceholder.Item
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected]
for the project I'm working on.
When nesting SkeletonPlaceholder.Item typescript errors occur as there is not children prop.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
index 58cfac7..7c8fc8d 100644
--- a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
+++ b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
@@ -33,6 +33,7 @@ declare type SkeletonPlaceholderProps = {
};
declare type SkeletonPlaceholderItemProps = ViewStyle & {
style?: StyleProp<ViewStyle>;
+ children?: JSX.Element[] | JSX.Element;
};
declare const SkeletonPlaceholder: React.FC<SkeletonPlaceholderProps> & {
Item: React.FC<SkeletonPlaceholderItemProps>;
This issue body was partially generated by patch-package.
This was required for me (parent placeholder element can take multiple children)
diff --git a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
index 58cfac7..0fb7755 100644
--- a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
+++ b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.d.ts
@@ -4,7 +4,7 @@ declare type SkeletonPlaceholderProps = {
/**
* Determines component's children.
*/
- children: JSX.Element;
+ children: JSX.Element[] | JSX.Element;
/**
* Determines the color of placeholder.
*/
@@ -33,6 +33,7 @@ declare type SkeletonPlaceholderProps = {
};
declare type SkeletonPlaceholderItemProps = ViewStyle & {
style?: StyleProp<ViewStyle>;
+ children?: JSX.Element[] | JSX.Element;
};
declare const SkeletonPlaceholder: React.FC<SkeletonPlaceholderProps> & {
Item: React.FC<SkeletonPlaceholderItemProps>;
Same for me. Can somebody create PR for this bug?
I appreciate if somebody create a PR
I appreciate if somebody create a PR
https://github.com/chramos/react-native-skeleton-placeholder/pull/109