react-native-collapsible-segmented-view icon indicating copy to clipboard operation
react-native-collapsible-segmented-view copied to clipboard

Segmented.ScrollView Props type is not being built with `children`

Open ronaldcurtis opened this issue 4 years ago • 1 comments

Current behavior

Typescript is emitting an error when using Segmented.ScrollView with children.

image

Expected behaviour

Should be able to use Segmented.ScrollView with children without any typescript issues.

Code sample

For Syntax Highlighting check this link

<Segmented.ScrollView>
  <Text>Hello world</Text>
</Segmented.ScrollView>

Screenshots (if applicable)

image

What have you tried

Can work around it by using <Segmented.FlatList>, but I'll eventually need to use <Segmented.ScrollView> in the future. I'm guessing it has something to do with how types are being built from this line:

https://github.com/PedroBern/react-native-collapsible-segmented-view/blob/main/src/ScrollComponents/ScrollView.tsx#L15

ronaldcurtis avatar May 25 '21 09:05 ronaldcurtis

Hiyah, can't fix this issue

Type '{ children: Element; style: { backgroundColor: string; }; contentContainerStyle: { flexDirection: "row"; flexWrap: "wrap"; }; refreshControl: Element; }' is not assignable to type 'IntrinsicAttributes & Pick<ScrollViewProps, "testID" | "style" | "onLayout" | "nativeID" | "accessible" | "accessibilityActions" | ... 99 more ... | "persistentScrollbar">'. Property 'children' does not exist on type 'IntrinsicAttributes & Pick<ScrollViewProps, "testID" | "style" | "onLayout" | "nativeID" | "accessible" | "accessibilityActions" | ... 99 more ... | "persistentScrollbar">

thanks in advance

lexycole avatar Nov 13 '22 01:11 lexycole