We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一个函数接受一个或者多个组件作为参数或者返回一个组件,就可以称之为高阶组件
一个函数接受一个或者多个函数作为参数或者返回一个函数,就可以称为高阶函数
// 装饰器的简单思路 import React, { Component } from 'react' const MyContainer = (WrappedComponent) => { class extends Component { render() { return <WrappedComponent {...this.props} /> } } }
const MyContainer = (WrappedComponent) => { return class HOC extends WrappedComponent { render() { return super.render() } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
高阶组件
高阶函数
高阶组件的两种方式
存在的问题
优势
The text was updated successfully, but these errors were encountered: