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

JSON Parse error: Unexpected identifier "success" using ReactNative

$
0
0

I am new to react native trying to save data to mogo db database I am getting the warning but my data is inserted in database.

My Code is as follows:

fetch("http://8ae1999e.ngrok.io/send-data", {            method: "post",            headers: {'Content-Type': 'application/json',            },            body: JSON.stringify({                name,                email,                phone,                picture,                salary,                position            })        }).then(res => res.json())            .then(data => {                console.log(data)                Alert.alert(`${data.name} is saved.`)                navigation.navigate("Home");            })

But it gives me warning

' JSON Parse error: Unexpected identifier "success" using ReactNative'

while posing data and can't navigate to Home Screen as well.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>