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

i get undefined is not an objetct react native

$
0
0

I'm new to react-native. I'm trying to make a login component and it throws undefined as error.

const [name, setName] = useState("");  const [password, setPassword] = useState("");  const pressHandler = () => {    navigation.navigate("Register");  };  const login = () => {    const { nombre } = this.name;    const { contraseña } = this.password;    fetch("http://http://192.168.0.20/dbReact.php", {      method: "POST",      Headers: {        Accept: "aplication/json","Content-Type": "application/json",      },      body: JSON.stringify({        nombre: nombre,        password: contraseña,      }),    })      .then((response) => response.json())      .then((responsejson) => {        alert(responsejson);        AsyncStorage.setItem("token", "86");      });  };

Viewing all articles
Browse latest Browse all 16750

Trending Articles



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