0
import TestAcademy from './test-academy.js';    
function MyApp({ Component, pageProps }) {
      const router = useRouter()
      const [approved, setApproved] = useState(false)

      ...

    return(
    <Link href='/test-academy' //pass approved as a prop>
        
    </Link>  )

So, I want to load the component TestAcademy, and when it loads I can access inside them, to props.approved

juliomalves
  • 42,130
  • 20
  • 150
  • 146
itsDev018
  • 66
  • 7
  • Does this answer your question: [Pass custom prop or data to Next JS Link component](https://stackoverflow.com/questions/61927604/pass-custom-prop-or-data-to-next-js-link-component)? You can't pass props directly, but you can pass data as query params instead. – juliomalves Dec 20 '21 at 22:34

1 Answers1

0
<Link
    href={{
    pathname: "/test-academy",
    query: { approved: approved }
/>
Akhil
  • 411
  • 4
  • 13