• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

{...getInputProps()} 이 코드를 어떤 코드라고 부르나요?

21.05.12 20:13 작성 조회수 201

0

 <Dropzone onDrop={(acceptedFiles=> console.log(acceptedFiles)}>
        {({ getRootPropsgetInputProps }) => (
          <div
            style={{
              width: 300,
              height: 240,
              border: '1px solid lightgray',
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
            }}
            {...getRootProps()}
          >
            <input {...getInputProps()} />
            <Icon type='plus' style={fontSize: '3rem' }} />
          </div>
        )}
      </Dropzone>

위의 코드에서

{...getRootProps()} 이 부분이 궁금합니다.

... <= 이런식으로 작성후 {}로 감싸고 함수를 작성하는거를 뭐라고 불러야하고 뭐라고 검색해봐야할까요??

답변 1

답변을 작성해보세요.

1

안녕하세요

... 이거는   한글로는 전개구문  영어로는 spread operator 라고 부르네요 ! 
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Spread_syntax
여기서 더 자세히 보시면 되겠습니다 수고하세요 ~ !