Next 13 Fetch Data turbo
Installation
npm i next13-fetch-data-turbo
Next 13 Fetch Data turbo allows the user to fetch data from an API and display it on the page.
How to use
- Create a new Next.js app
- Install the Next 13 Fetch Data turbo
npm install @vercel/turboreact
- Add the turbo to your Next.js app
// pages/_app.js
import { TurboReact } from "@vercel/turboreact";
export default function App({ Component, pageProps }) {
return (
<TurboReact>
<Component {...pageProps} />
</TurboReact>
);
}
- Create a page that uses the turbo
// pages/index.js
import { useFetch } from "@vercel/turboreact";
export default function Home() {
const { data, error } = useFetch(
"https://api.github.com/repos/vercel/turboreact"
);
if (error) {
return <div>failed to load</div>;
}
if (!data) {
return <div>loading...</div>;
}
return (
<div>
<h1>{data.name}</h1>
<p>{data.description}</p>
</div>
);
}
- Start the development server
npm run dev
- Open http://localhost:3000 with your browser to see the result.
- Edit the page and save it to reload the page.
- Add
?turbo
to the URL to see the turbo in action. - Learn more about Next.js on the Next.js documentation.
- Learn more about Turbo on the Turbo documentation.
- Learn more about React on the React documentation.
- Learn more about Vercel on the Vercel documentation.
License
Copyright © 2022 Miguel Gargallo, Pencil Works LLC, ITAMAESAN ORG, SUPERDATAS, Pylar Team.
| Pylar AI creative ML | Permissions | Limitations | Conditions |
| -------------------------------------------------------------------------------------- | ------------------------------ | ----------------- | --------------------------------------------------- | --- |
| November 1st November of 2022 |
Section I: Preamble
This license is a legal agreement between you and the Pylar AI creative ML for the use of Pylar AI creative ML. By obtaining the Pylar AI creative ML you agree to be bound by the terms and conditions of this license. If you do not agree to the terms and conditions of this license, you are not authorized to obtain the Pylar AI creative ML.