MCPcopy Create free account
hub / github.com/kenberkeley/react-demo /

Class

src/utils/HoC/ExampleHoC.js:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3/* 高阶组件 High Order Component 例子 */
4const ExampleHoC = WrappedComponent => class extends Component {
5 componentWillMount() {
6 console.info('[HoC] componentWillMount')
7 }
8
9 componentDidMount() {
10 console.info('[HoC] componentDidMount')
11 }
12
13 render () {
14 return <WrappedComponent {...this.props} />
15 }
16}
17
18export default ExampleHoC
19

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected