.env
에서 REACT_APP_
prefix 붙인 변수를 읽을 수 있음process.env.NAME
형식으로, html에서는 %NAME%
사용 가능IntersectionObserver
interfaceconstructor(callback[, options])
callback
: (entreis: [IntersectionObserverEntry](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry), observer: IntersectionObserver) ⇒ void
options
root
: ancestor element or document 지정rootMargin
: CSS margin property와 유사하게 지정trheshold
: number | number[]
const fetcher = url => axios.get(url).then(res => res.data)
function App () {
const { data, error } = useSWR('/api/data', fetcher)
// ...
}
TypeError
)yarn upgrade
를 하면 yarn.lock만 변경되고 package.json
에 반영되지 않음sudo yarn global add syncyarnlock
syncyarnlock -s -k