im trying to fill up my view with elements. I am trying to use SetEvents to make the UI update, however it is not working.
My getEventsInCity returns standardResponse, .data of this is of type IEvent[]
My state
const [events, setEvents] = useState<IEvent[]>([testEvent,testEvent,testEvent])
My function
async function testBtn() { setCity("XXXX") const userInfo: LoginRequest = { uniqueId: 'XXXXX', phoneOs: 'XXXX', gender: 'X', phoneName: 'XXXX', lat: XXXX, lon: XXXX } await login(userInfo) getEventsInCity("XXXX").then((o) =>{ setEvents([...o.data]) }).catch((err) => { console.log(err) })}
My HTML (I am using a bottom sheet package)The last EventCell is just for testing that my view is showing
<BottomSheetScrollView horizontal={false} showsHorizontalScrollIndicator={false} style={styles.eventScrollView}> {events.map((e, i) => {<EventCell event={e} onClick={(eventClicked)} /> })}<EventCell event={testEvent} onClick={(eventClicked)} /></BottomSheetScrollView>