所以,我有这个组件results.js,在这个组件中我从我们的后端服务器获取数据。
import { useRouter } from 'next/router';
import Navigation from '../../components/Navigation';
const Results = (props) => {
return (
<div>
<Navigation />
{console.log(props)}
</div>
)
}
export const getServerSideProps = async (context) => {
// Fetch all the id's
const res = await fetch(`https://api.myapi.com/results`)
const results = await res.json()
return { props: { results } }
}
我有这个导航
import Link from 'next/link'
const Navigation = () => {
return (
<div>
<Link as="/" href="/"><div>Homepage</div></Link>
<Link as={`/results`} href={`/results`}><div>ResultsPage</div></Link>
</div>
)
}
export default Navigation;
我的问题现在来了:
为什么当我刷新时,它会拨打我的电话,但在网络开发人员控制台中看不到?
为什么在我的开发人员控制台中导航到页面时不是?
我刷新时的示例:
我使用导航时的示例:

