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;