[英]recompose pure or React.memo?
I'm asking myself if the React.memo is exactly the same as recompose pure() ... 我问自己React.memo是否与重组pure()完全相同...
import { pure } from 'recompose';
export default pure(MyComp);
or 要么
import React, { memo } from 'react';
export default memo(MyComp);
Any thoughts? 有什么想法吗?
According to the React documentation . 根据React文档 。
React.memo is a higher order component. It's similar to React.PureComponent but for function components instead of classes.
So they are not exactly the same, but they serve the same purpose. 因此它们并不完全相同 ,但是它们具有相同的目的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.