래퍼 구성 요소를 소품으로 전달하려고합니다. 이게 기술적으로 React에서 가능한 것입니까?ReactJS에서 래퍼 구성 요소를 소품으로 전달
import React, {Component, PropTypes} from 'react';
import ChildComp from './child-comp';
class Comp extends Component {
render() {
const { Wrapper } = this.props;
return (
<Wrapper>
<ChildComp />
</Wrapper>
);
}
}
Comp.propTypes = {};
export default Comp;
소품 프록시 [고차 성분 (https://medium.com/@franleplant/react-higher-order-components-in-depth-cf9032ee6c3e#.aosc7lsuy) 수도 당신이 찾고있는 것. 기본적으로 래핑 (wrapping) 함수는 컴포넌트를 전달합니다. –
HOC 문서 : http://stackoverflow.com/documentation/reactjs/1185/components/4649/creating-components#t=20161223100405611594 –