Next.js Discord

Discord Forum

getStaticProps returns undefined props

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Hey! I have an issue trying to retrieve information with a database we are trying to configure with Prisma and Planetscale, for some reason I'm not successful when trying to handle StaticProps.
export default function Categories({ categories  }: CategoriesProps) {
  console.log(categories)
  return (
    <main className='main-class pb-20'>,
      <nav className="navbar-style">
        <div>
          <ul className='navbar-container'>
              <li>  
                <Link href="/about" className='hover:underline'>Escribir reseña</Link>
              </li>
            </ul>
        </div>
      </nav> 
      <div className="body-container">
          <h1 className='text-2xl header'>
            Todos los programas en un solo lugar
          </h1>
          <ul >
              <li>
                <Link href="/" className='hover:underline'>Software CRM</Link>
              </li>
          </ul>
      </div>
    </main> 
  )
}
export async function getStaticProps() {
  const categories = { id : "Server functions" }
  return {
    props: {
      categories,
    },
  };
}

7 Replies