@momo-kits/foundation 0.81.2 → 0.81.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Layout/ItemList.tsx +8 -6
- package/Layout/types.ts +0 -2
- package/Layout/utils.ts +2 -2
- package/package.json +1 -1
package/Layout/ItemList.tsx
CHANGED
|
@@ -24,14 +24,16 @@ const ItemList: FC<FlatListProps<any>> = ({
|
|
|
24
24
|
console.warn('Wrong children type for this component, expected are Item');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return (
|
|
28
|
+
<View
|
|
29
|
+
style={
|
|
30
|
+
numColumns > 1 && {
|
|
30
31
|
marginRight: gutterSize,
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
}>
|
|
34
|
+
{children}
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
return (
|
package/Layout/types.ts
CHANGED
package/Layout/utils.ts
CHANGED
|
@@ -8,7 +8,7 @@ import React, {Fragment, ReactElement, useEffect, useState} from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
const validateChildren = (
|
|
10
10
|
children: React.ReactNode | React.ReactNode[],
|
|
11
|
-
childrenTypes: Array<React.
|
|
11
|
+
childrenTypes: Array<React.ReactNode>,
|
|
12
12
|
) => {
|
|
13
13
|
const validateType = (child: React.ReactElement) => {
|
|
14
14
|
const valid = childrenTypes.some(
|
|
@@ -17,7 +17,7 @@ const validateChildren = (
|
|
|
17
17
|
if (!valid) {
|
|
18
18
|
console.warn(
|
|
19
19
|
`Wrong children type for this component, expected are ${childrenTypes
|
|
20
|
-
.map(
|
|
20
|
+
.map(item => item)
|
|
21
21
|
.join(', ')}.`,
|
|
22
22
|
);
|
|
23
23
|
}
|