Hi, I’m a newbie to ReScript. I’m trying to bind and use “react-native-skeleton-placeholder” with react native, and I have a question.
The types are as follows
declare type SkeletonPlaceholderItemProps = ViewStyle & {
style?: StyleProp<ViewStyle>;
children?: React.ReactNode;
};
declare const SkeletonPlaceholder: React.FC<SkeletonPlaceholderProps> & {
Item: React.FC<SkeletonPlaceholderItemProps>;
};
export default SkeletonPlaceholder;
And you can use it like this
import SkeletonPlaceholder from 'react-native-skeleton-placeholder'
function Skeleton() {
return (
<SkeletonPlaceholder borderRadius={4}>
<SkeletonPlaceholder.Item flexDirection="row" alignItems="center">
<SkeletonPlaceholder.Item width={60} height={60} borderRadius={50} />
<SkeletonPlaceholder.Item marginLeft={20}>
<SkeletonPlaceholder.Item width={120} height={20} />
<SkeletonPlaceholder.Item marginTop={6} width={80} height={20} />
</SkeletonPlaceholder.Item>
</SkeletonPlaceholder.Item>
</SkeletonPlaceholder>
)
}
For SkeletonPlaceholder, I can bind it with “default” when bind it, the problem is when bind SkeletonPlaceholder.Item.
The reason is that the Item is not exported separately, and I need to access it as SkeletonPlaceholder.Item, so I’m wondering how to do the binding in reScript in this situation.
If you have any ideas, please help!