| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- middleware
- CSS
- 삶
- 기준
- SSR
- API
- evm
- Redux
- typeScript
- express.js
- graphQL
- HTML
- error
- node.js
- blockchain
- solidity
- nextJS
- hardhat
- web
- REACT
- built in object
- useState
- Props
- bitcoin
- Ethereum
- CLASS
- tailwindcss
- Interface
- JavaScript
- concept
- Today
- Total
목록getstaticprops (2)
ReasonJun
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 ( {time} ); } The data is updated when the page is refreshed.
Normally, when importing data in React, import it from useEffect. However, in Nextjs, it is imported using a different method. (Of course, you can also import it using useEffect.) getStaticProps getStaticProps is a Next.js function that allows you to pre-render your pages on the server. This can improve performance and SEO, as the browser does not need to render the pages on its own. The getStat..