Answers for "fetch data in next js"

-1

fetch data in next js

export const getStaticProps = async () => {
  const res = await fetch("https://jsonplaceholder.typicode.com/users");
  const data = await res.json();

  return {
    props: {
      people: data,
    },
  };
};
Posted by: Guest on March-22-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language