score:0

from https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation

note: you should not use fetch() to call an api route in getstaticprops. instead, directly import the logic used inside your api route. you may need to slightly refactor your code for this approach.

fetching from an external api is fine!

score:0

you should check if categories exist

export default function homemain({categories}) {
if(categories){
return <loading component />
}

rest of the code...

}

Related Query

More Query from same tag