Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
82 views
in Technique[技术] by (71.8m points)

javascript - How can I to see the value of variable in react-native?

fetch('https://localhost:3000/api/usuario/login', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    userName: user,
    Userpassword: password
    console.log(Userpassword) //-- > BUT THIS DOSEN′ T WORK!
  })
});
question from:https://stackoverflow.com/questions/65643047/how-can-i-to-see-the-value-of-variable-in-react-native

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are putting it in the wrong location.

console.log(Userpassword); // this ok

fetch('https://localhost:3000/api/usuario/login', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    userName: user,
    Userpassword: password
  })
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...