0

I am new to Next.js and I want to know, What new data fetching patterns have been explored by Next.js 13.4.9? How well does dynamic data fetching work?

For example, if you wanted to fetch some data, the original version of Next.js looked like this:

import React from 'react';
import 'isomorphic-fetch';
 
export default class extends React.Component {
  static async getInitialProps() {
    const resp = await fetch('https://api.company.com/user/12345');
    const data = await resp.json();
    return { username: data.profile.username };
  }
}

What new data fetching patterns have been explored by Next.js 13.4.9?

Drew Reese
  • 165,259
  • 14
  • 153
  • 181

1 Answers1

0

Check out https://nextjs.org/docs/app/building-your-application/data-fetching.

You don't need to import fetch from any external library. Rather, you should not. Next.js takes care of that.

Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122