标签:实现 基本概念 编写 质量 extend import pre 返回值 render
setTimeout(() => {
console.log('1')
}, 1000)
foo = (x) => {
return function () {
return x
}
}
export default connect(maoStateToProps, mapDispatchToProps)(Header)
import React from 'react'
export default class Start extends React.Component {
render () {
return (
<div>组件A</div>
)
}
}
import React from 'react'
function A (WrappedComponent) {
return class Start extends React.Component {
render () {
return (
<div>
<div>这是组件A</div>
<WrappedComponent />
</div>
)
}
}
}
export default A
import React from 'react'
import a from './A'
class B extends React.Component {
render () {
return (
<div>这是组件B</div>
)
}
}
export default a(B)
import React from 'react'
import a from './A'
@a
class B extends React.Component {
render () {
return (
<div>这是组件B-</div>
)
}
}
export default B
标签:实现 基本概念 编写 质量 extend import pre 返回值 render
原文地址:https://www.cnblogs.com/liea/p/11823740.html