I'm currently working on rendering a landing page using getStaticProps
in Next.js, but I'm encountering unexpected behavior. Here's the snippet of my component:
import { GetStaticProps } from 'next'
const Brief = (props) => {
console.log(JSON.stringify(props)) // returning an empty object
return (
<>
{props[0]}
{props[1]}
{props[2]}
</>
)
}
export const getStaticProps: GetStaticProps = async (context) => {
const WhatIUse = <div className="WhatIUse">What technology I use</div>
const introduction = <div className="introduction">Introduction to the page</div>
const ContactInfo = <div className="ContactInfo">Where you can contact me</div>
return {
props: [introduction, WhatIUse, ContactInfo]
}
}
export default Brief
The problem I am facing is that the logging statement indicates that props
is being returned as an empty object. What could be causing this issue?