-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
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
精读《我不再使用高阶组件》 #42
Comments
从评论里看出,
renderProps 为了解耦,让控制权从上到下传递,而底层实现不需要了解上层实现,这是解决 JSX 修改组件模版问题的方法之一,作为优化点之一,可以考虑让传入的 props 自身作为一个组件: const View = ({title}) => <div>{title}</div>
// ...
render() {
return (
<Component view={View} />
)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
本期精读文章是:https://medium.com/tandemly/im-breaking-up-with-higher-order-components-44b0df2db052
作者对 HOC 提出了不一样的观点,让我们一起看看吧。
The text was updated successfully, but these errors were encountered: