I am faced with a challenge while attempting to pass the article
props in Next.js using getStaticProps(). The current code is throwing an error due to the fact that article
is being treated as an [object Promise]
.
const getArticles = (uid) =>
client
.query(Prismic.Predicates.at('my.article.categories.category', uid), {
orderings: '[my.article.date_written desc]',
})
.then((res) => res.results);
const articles = getArticles(params.uid);
I need assistance on how to properly set articles
as res.results
.