i am getting Unhandled Runtime Error Error: Request failed with status code 500
when i console.log(gotid
) i am getting id
but when i pass it to axios in network tab it becomes https://ask-over.herokuapp.com/questone/undefined
const [Item, setItem] = useState([]);
const router = useRouter();
var id = router.query.itmid;
var gotid = id;
console.log(gotid);
useEffect(() => {
axios
.get("https://ask-over.herokuapp.com/questone/" + gotid)
.then((result) => {
console.log(result);
// document.title = result.data[0].Name;
setItem(result.data);
});
// console.table(this.state.items);
}, [id]);