I'm making a FlatList rendering Alarm items. (react-native-simple-alarm)
the tsx file where my FlatList is
const [alarms, setAlarms] = useState<AlarmType[]>([]);...const renderItem: ListRenderItem<AlarmType> = ({item}) => { return <ListItem props={item} />; // i have an error here on props };...<FlatList ref={flatListRef} scrollEnabled={scrollEnabled} data={alarms} renderItem={renderItem} keyExtractor={item => item.oid} //error here on keyExtractor />
the Alarm list items that FlatList renders
import {Alarm as AlarmType} from 'react-native-simple-alarm/dist/Types';const ListItem = (props: AlarmType) => { const deleteItem = async (oid: string | number) => { try { await deleteAlarmById(oid);...
in ListItem, I also get errors saying that oid cannot be undefined.Not sure it's because of this problem, but the time properties of alarm instances that i made in application get messed up, as I make another instances
How can I use Alarm type perfectly?? please help me