Open chenchenyuyu opened 5 years ago
const getDisplayName = (WrappedComponent) => { const { displayName, name } = WrappedComponent || {}; return displayName || name || 'Component'; } // 高阶组件设置显示名称 WithErrorHandler.displayName = `withErrorHandler(${getDisplayName(WrappedComponent)})`;