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 |
Tags
- Spring
- err_connection_refused
- npm에러
- set
- 타입스크립트
- materialicons
- 리액트네이티브아이콘
- extends
- TS
- Next.js
- 이진탐색
- async
- reactnative error
- generic
- array
- map
- mainapplication.kt
- reactnative
- 스크롤이벤트
- 상속
- interface
- 안드로이드빌드에러
- 배열중복요소제거
- 슬라이딩윈도우
- app:compiledebugkotlin
- Filter
- javascript
- app.post
- forwardref type
- react
Archives
- Today
- Total
목록Fetch (1)
rhanziy
react. api 정보 가져오기
다양한 api 사이트에서 배열에 담긴 정보를 가져오는 법! useEffect(()=> { fetch("https://yts.mx/api/v2/list_movies.json?minimum_rating=9&sort_by=year") .then((response) => response.json()) .then((json) => { setMovies(json) }); }, []); useEffect( )를 사용해서 fetch( ).then( ).then( ); 이런 식으로 가져와도 되지만 가독성을 위해 아래와 같이 async/await을 사용해 json으로 변환해서 가져온다. function App(){ const [movies, setMovies] = useState([]); const getMovies = ..
React
2022. 3. 12. 02:16