ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
nodejs/next/posts/pages/[pid].jsx
import Link from 'next/link'
import { useRouter } from 'next/router'

import { useEffect, useState } from 'react'

export default function Post() {
  const router = useRouter()
  const { pid } = router.query
  const routeAsPath = useRouter().asPath
  const [count, setCount] = useState(0)
  const [perPageCount, setPerPageCount] = useState(0)
  useEffect(() => {
    setPerPageCount(0)
  }, [routeAsPath])
  return (<>
    <p>pid: {pid}</p>
    <p>count: {count}</p>
    <p>perPageCount: {perPageCount}</p>
    <p>routeAsPath: {routeAsPath}</p>
    <button
      onClick={(ev) => {
        setCount(c => c + 1)
        setPerPageCount(c => c + 1)
      }}
    >
      count++
    </button>
    <ul>
      <li><Link href="/">Index</Link></li>
      <li><Link href="/1">1</Link></li>
      <li><Link href="/2">2</Link></li>
      <li><Link href="/3">3</Link></li>
    </ul>
  </>)
}