I'm Using React and nodejs I can successfully retrieve the data but I'm Unable to store it in a variable
OnSubmit(e){
const user={
email:this.state.email,
password:this.state.password,
}
axios.post('http://localhost:5000/Users/login',user)
.then(res=>(console.log(res.data)))//want to store this res.data in a variable
localStorage.setItem("token","got")
this.setState({
loggedin:true
})