Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

javascript - How to use completion handler in Next.js?

I am wondering wether completion handler server method call is possible in Next.js or only the await approach as most tutorial show?

We would collect the codes REact Native and Next.js both uses in a parent folder, but await willl not help us.

HomePage.getInitialProps = async () => {
  const initialData = {};
  await registerTempUser();
  const homeData = await homePageData;
  const events = await eventList;
  initialData.homePageData = homeData.data;
  initialData.events = events.data;
  return { initialData: initialData, namespacesRequired: ["translate"] };
};
question from:https://stackoverflow.com/questions/66062607/how-to-use-completion-handler-in-next-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...