developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

Next.js/JS : Properties intended for your component must be nested under the `props` key #193

Open developerasun opened 2 years ago

developerasun commented 2 years ago

issue : Next js throwing error during data fetching

in codes,

export const getStaticProps = async () => {
    const res = await fetch('https://jsonplaceholder.typicode.com/users')
    const data = res.json()
    return {
        // data fetching in Next js will be done in behind the scene 
        // and it will reflected to before component mounts. 
        ninjas : data, 
    }
}

in terminal,

next-props-under-prop-key