Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

JSON value '' of type NSNull cannot be converted to NSString IOS Simulator

$
0
0

I am getting the following error screen every time I'm scrolling or navigating the app when I reload my React Native app in iOS Simulator.

enter image description here

I'm not sure what could be the reason for this error.

I thought it could potentially be something wrong with the source of my images but don't think that's the issue.

const UserItem = (props: { onSelect: () => void, user: User }) => {return <AccountContainer onPress={props.onSelect}><AccountImage source={{ uri: props.user.photoUrl }} /><Text text={props.user.username} /></AccountContainer>

}

I'm also making sure I strinfiy the json objects as I've seen people had this same issue with AsyncStorage

const save = async <T>(key: string, value: T): Promise<T | null> => {  try {    await AsyncStorage.setItem(key, JSON.stringify(value));    return value;  } catch (error) {    return null;  }

Viewing all articles
Browse latest Browse all 16750

Trending Articles