자바스크립트 생성자1 [React] super(props); 보통 아래와 같은 구조로 리액트 Component 구조를 갖는다. class App extends React.Component { constructor() { super(); ... } render() { return (); } } super 는 상위 객체의 Method를 가져오는 것이다. 위에서 super();는 React Component에 object 와 Method를 전달하기 위한 것이다. super(props), constructor(props)를 선언할 경우도 상위 컴포넌트에 object를 전달해주는 성격이 된다. 참조: min9nim.github.io/2018/12/super-props/ velog.io/@hytenic/Javascript-javascript-OOP-Class-Super ve.. 2021. 2. 16. 이전 1 다음