๐Ÿค ์€์ง€log ๐Ÿค

[REACT] useEffect๊ฐ€ 2๋ฒˆ์‹คํ–‰๋ ๋•Œ ๋ณธ๋ฌธ

๐Ÿ’™ React

[REACT] useEffect๊ฐ€ 2๋ฒˆ์‹คํ–‰๋ ๋•Œ

Eun_zii 2022. 10. 6. 14:39

 

 

useEffect(() => {},[])

useEffect 2๋ฒˆ์งธ ์ธ์ž์— ๋นˆ ๋ฐฐ์—ด์„ ๋„ฃ์–ด์ฃผ๊ฒŒ ๋˜๋ฉด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์ฒ˜์Œ ๋ Œ๋”๋ง ๋ ๋•Œ๋งŒ ์‹คํ–‰๋œ๋‹ค.

 

๐Ÿ“Œ useEffect ์˜ค๋ฅ˜๋กœ 2๋ฒˆ ์‹คํ–‰ ๋ ๋•Œ ๐Ÿ“Œ

src/index.js์—์„œ
<React.StrictMode> ํƒœ๊ทธ๋กœ ์ด ๊ฐ์‹ธ์ ธ์žˆ์œผ๋ฉด
๊ฐœ๋ฐœ๋ชจ๋“œ์—์„œ ๋‘ ๋ฒˆ์”ฉ ๋ Œ๋”๋ง๋œ๋‹ค.

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import reportWebVitals from './reportWebVitals'
import './index.css'

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  <React.StrictMode> โฌ… ์ง€์šฐ๊ธฐ
    <App />
  </React.StrictMode>, โฌ… ์ง€์šฐ๊ธฐ
)

 

 

 

 

 

์ฐธ๊ณ : https://velog.io/@hyes-y-tag/React-useEffect%EA%B0%80-%EB%91%90%EB%B2%88-%EC%8B%A4%ED%96%89%EB%90%9C%EB%8B%A4%EA%B3%A0

 
728x90

'๐Ÿ’™ React' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[REACT] SCSS  (0) 2022.10.06
[REACT] SPA ์™€ async  (0) 2022.10.06
[REACT] To-do List ๋งŒ๋“ค๊ธฐ  (0) 2022.10.06
[REACT] Pagination ๊ณผ Querystring  (0) 2022.10.06
[REACT] Instagram _ Log-In  (0) 2022.10.06