Open arshiya-adafsa opened 1 year ago
I was facing the same issue. I made a few improvements to my implementation and was able to enhance performance.
1- I made sure I am passing components correctly I am utilizing touchableComponent prop. I was passing it like this:
<Accordion
touchableComponent={(props) => <myTouchable {...props}>}
{...}
/>
corrected it by passing it directly to avoid re-renders
<Accordion
touchableComponent={myTouchable}
{...}
/>
2- I used useMemo for renderSectionTitle, renderHeader, renderConten to also avoid re-render when state is changed.
const SliderHeader = React.memo(({ item }) => {
...
});
<Accordion
renderHeader={(item) => <SliderHeader item={item} />}
{...}
/>
Review your code throughly and make sure your utilizing React Memo when its needed.
very slow when there is more than 20 items