I want to get data (= user id) after I post How to I store a response data to variable..?
async function start() {
const req = {
'user-num': count,
};
const response = await axios.post(NumURL, { req });
setState(response.data);
// userid(response.data);
console.log(response.data);
// return data
}
I want to get the response data... and the backend api just give json format like {"user-id" : 3}