Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
Is not-returned code and content available for public in the source code?

I am new to nextjs and webdev. I been following a couple of tutorials but I still have a doubt. Lets say I have this page:

// /pages/test/load.js

import Link from 'next/link'
import Layout from '../../components/layout'
import { useRouter } from "next/router";


export default function TestLoad() {
    const router = useRouter();
    const query = router.query;
    console.log(query.info)
    // I don't want to show any of this code here, or the return in case queri.info != true.
    if (query.info == 'true') {
        console.log('TRUE RETURN')
        return (
            <Layout>
                <h1>First Post</h1>
                <h2>
                    <Link href="/">
                        <a>Back to home</a>
                    </Link>
                </h2>
                <p>Some hidden content that I don't want to show to all the users.</p>
                <p>Blah</p>
                // Images and more stuff

            </Layout>
        )
    } else {
        return (
            <>
                <h1>Nothing to show</h1>
                    <Link href="/">
                        <a>Back to home</a>
                    </Link>
            </>
        )
      }

}

If I deploy this code with Vercel for example, and try access to http://<some-url>/test/load?info=false is the code/info for query.info == 'true' available?

Of course in this particular case anyone can just try to access to http://<some-url>/test/load?info=true and view the content.

My idea is then try to wrap up the true/false logic into getStaticProps.

My ultimate idea is to render a different html code depending on the props passed by getStaticProps.

Thanks!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!