<aside> 💡

프래그먼트와 포털을 통해 코드를 깔끔하게 작업할 수 있다!

</aside>

React.Fragment (Wrapper, <>)

Wrapper.js

const Wrapper = props => {
    return props.children; // children이 포함하고 있는 내용 : 여는 태그와 닫는 태그 사이의 모든 내용 포함
};

export default Wrapper;

Untitled

<aside> 💡 보통 자체적으로 Wrapper를 만들지는 않고 Fragment 를 이용해서 감싸준다.

</aside>