I am getting an type error using typescript in my React Project. I am using the alert component and rendering my buttons conditionally.
const buttons = () => { if (item.type === 'volume') { // volume: no need to check anything else. overwrite rows and assign volume return [ { text: 'Cancel', onPress: () => console.log('saving cancelled'), style: 'cancel', }, { text: 'Overwrite', onPress: () => assignToVolume(), }, ]; } else if (isAssigned === 'volume'&& item.type) { // delete volume and assign the new item return [ { text: 'Cancel', onPress: () => console.log('saving cancelled'), style: 'cancel', }, { text: 'Overwrite', onPress: () => owVolumeAssignNewItem(), }, ]; }}Alert.alert('Midi Mapping Alert', message(), buttons());
I have tried adding the following to my button function which remove the warning but I am not sure what impact it will have
const buttons = (): any =>{{