인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

thinkinghs9862's profile image
thinkinghs9862

asked

Learn by Following Along Node, React Series - Building a Shopping Mall Site [Complete Renewal]

useState 가지고 올 때 왜 {}로 감싸나요?

Written on

·

189

0

import React, {useStatefrom 'react';

이처럼 useState를 import할 때 왜 {}로 감싸주는지 궁금합니다. React는 {}로 감싸지 않고 그냥 이용하는데요.

nodejsmongodb웹앱reduxreact

Answer 1

0

johnahn님의 프로필 이미지
johnahn
Instructor

안녕하세요 Hosik Ham님    
리액트에서 import 를 해올 때 
default 로 가져오는것은   {} 없이  그리고  default가 아닌것을 가져올때는 {} 를 사용해서 가져옵니다 
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Statements/import
여기 가셔서 한번 읽어보시면 도움이 될거라 생각됩니다 ^^ 

thinkinghs9862's profile image
thinkinghs9862

asked

Ask a question