일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 삶
- Interface
- typeScript
- built in object
- API
- useState
- Redux
- SSR
- tailwindcss
- HTML
- hardhat
- evm
- CSS
- node.js
- nextJS
- 기준
- JavaScript
- blockchain
- express.js
- concept
- bitcoin
- middleware
- Ethereum
- Props
- REACT
- error
- solidity
- CLASS
- web
- graphQL
- 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.
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b0vDEO/btsketJY2zU/npae5G20gFkZSDduAWKQVk/img.png)
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..