Modifiers cannot appear here.ts(1184) error while using getStaticProps in Nextjs app

Viewed 32

I don't know why when I use getStaticProps function in my component, I get an error : enter image description here

but when I place it before my component declaration function, the error goes away!! it was written in documents that we need to place in in the component function

1 Answers

Have a good read of the documentation, it tells you to put it outside of your component function.

Related