250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- node.js
- typeScript
- built in object
- 삶
- middleware
- graphQL
- API
- concept
- JavaScript
- tailwindcss
- web
- Interface
- solidity
- blockchain
- bitcoin
- REACT
- error
- Redux
- express.js
- CSS
- 기준
- HTML
- useState
- SSR
- Ethereum
- evm
- hardhat
- Props
- CLASS
- nextJS
Archives
- Today
- Total
ReasonJun
Next.js : getStaticProps with revalidata (ISR) 본문
728x90
import Head from 'next/head';
import { Inter } from 'next/font/google';
import Link from 'next/link';
import { useEffect, useState } from 'react';
const inter = Inter({ subsets: ['latin'] });
export async function getStaticProps() {
return {
props: { time: new Date().toISOString() },
};
}
export default function ISR({ time }) {
return (
<>
<Head>
<title>Create Next App</title>
<meta name='description' content='Generated by create next app' />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link rel='icon' href='/favicon.ico' />
</Head>
<main>
<h1>{time}</h1>
</main>
</>
);
}
The data is updated when the page is refreshed.
728x90
'Frontend > Next.js' 카테고리의 다른 글
Next.js : Apply common layout (0) | 2023.06.18 |
---|---|
Next.js : Image component (0) | 2023.06.18 |
Next.js : How to bring data in Nextjs (getServerSideProps) (SSR - Server Side Render) (0) | 2023.06.17 |
Next.js : How to bring data in Nextjs (getStaticPaths) (SSG) (0) | 2023.06.17 |
Next.js : How to bring data in Nextjs (getStaticProps) (SSG) (0) | 2023.06.16 |
Comments