Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React native ref Property 'ref' does not exist on type 'IntrinsicAttributes &

$
0
0

I am getting the following error but I am not able to figure out how to fix it someone can help me out.

Below is also the link on expo with the complete code.

Error on <AppIntroSlider /> which is reported by snack expo

enter image description here

Example:

Type '{ ref: (ref: any) => any; data: { key: string; title: string;text: string; backgroundColor: string; }[]; renderItem: ({ item }:any) => Element; renderPagination: (activeIndex: number) => Element;scrollX: (scrollXList: any) => any; }' is not assignable to type'IntrinsicAttributes & { data: any[]; renderItem: (info:ListRenderItemInfo & { dimensions: { width: number; height:number; }; }) => ReactNode; renderSkipButton?: (() => ReactNode) |undefined; ... 19 more ...; scrollX?: ((a: any) => void) | undefined;} & FlatListProps<...> & { ...; }'. Property 'ref' does not exist ontype 'IntrinsicAttributes & { data: any[]; renderItem: (info:ListRenderItemInfo & { dimensions: { width: number; height:number; }; }) => ReactNode; renderSkipButton?: (() => ReactNode) |undefined; ... 19 more ...; scrollX?: ((a: any) => void) | undefined;} & FlatListProps<...> & { ...; }'.

Link: expo

  const slider = useRef(null);  ...<AppIntroSlider      ref={(ref: any) => (slider.current = ref)}      ...
type ItemTProps<ItemT> = {  data: ItemT[];  renderItem: (    info: ListRenderItemInfo<ItemT> & {      dimensions: { width: number; height: number };    }  ) => React.ReactNode;  renderSkipButton?: () => React.ReactNode;  renderNextButton?: () => React.ReactNode;  renderDoneButton?: () => React.ReactNode;  renderPrevButton?: () => React.ReactNode;  onSlideChange?: (a: number, b: number) => void;  onSkip?: () => void;  onDone?: () => void;  renderPagination?: (activeIndex: number) => React.ReactNode;  activeDotStyle: ViewStyle;  dotStyle: ViewStyle;  dotClickEnabled: boolean;  skipLabel: string;  doneLabel: string;  nextLabel: string;  prevLabel: string;  showDoneButton: boolean;  showNextButton: boolean;  showPrevButton: boolean;  showSkipButton: boolean;  bottomButton: boolean;  scrollX?: (a: any) => void;} & FlatListProps<ItemT>;const AppIntroSlider: FunctionComponent<ItemTProps<any>> = ({  data,  renderItem,  renderSkipButton,  renderNextButton,  renderDoneButton,  renderPrevButton,  onSlideChange,  onSkip,  onDone,  renderPagination,  activeDotStyle = {    backgroundColor: 'rgba(255, 255, 255, .9)',  },  dotStyle = {    backgroundColor: 'rgba(0, 0, 0, .2)',  },  dotClickEnabled = true,  skipLabel = 'Skip',  doneLabel = 'Done',  nextLabel = 'Next',  prevLabel = 'Back',  showDoneButton = true,  showNextButton = true,  showPrevButton = false,  showSkipButton = false,  bottomButton = false,  extraData,  scrollX,  ...otherProps}: any) => {

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>