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

Typescript: How to suppress "No overload matches this call"?

$
0
0

So I have a React Native application that uses Native Base as UI lib and Typescript.

Now there is an Accordion which - as soon its expanded - renders a second (nested) Accordion. The problem is that TypeScript complains:

A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

Which is perfectly fine. But when I add this listKey to my Accordion, TypeScript complains about No overload matches this call.

How can I suppress this warning? Because Native Base doesn't provide listKey as prop for their Accordion.

Here is the code:

imports ...type Props = {};const Test: React.FC<Props> = ({}) => {  const renderNestedAccordion = () => {    return (<View><ComponentWithAccordion></ComponentWithAccordion></View>    );  };  const dataArray = [{content: renderNestedAccordion()}];  return (<Accordion      listKey={'acc'} // error      dataArray={dataArray}    />  );};export default Test;

Viewing all articles
Browse latest Browse all 6211

Trending Articles



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