// https://mattclaffey.medium.com/adding-react-refs-to-an-array-of-items-96e9a12ab40c
const itemEls = useRef(new Array())
{items.map(item => (
<p key={item} ref={(element) => itemEls.current.push(element)}>{item}</p>
))
/*both useRef({}) and useRef([]) work..*/
import CalendarStrip from 'react-native-calendar-strip';
export default function App() {
const one = useRef({});
let x= [];
function q()
{
one.current.getNextWeek();
two.current.getNextWeek();
}
return (
<View>
<CalendarStrip
ref={(el)=> one.current[0] = el}
style={{height:150, paddingTop: 20, paddingBottom: 10}} rightSelector={x} leftSelector={x}
/>
<CalendarStrip
ref={(el)=>one.current[1] =el}
style={{height:150, paddingTop: 20, paddingBottom: 10}}
/>
<TouchableOpacity onPress={()=>q()}>
<Text>
Click Me
</Text>
</TouchableOpacity>
</View>
);
}