Skip to content
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

HoC形式下的一个获取内部组件props的问题 #14

Open
mooncakelmn opened this issue Jan 17, 2019 · 0 comments
Open

HoC形式下的一个获取内部组件props的问题 #14

mooncakelmn opened this issue Jan 17, 2019 · 0 comments

Comments

@mooncakelmn
Copy link

mooncakelmn commented Jan 17, 2019

(按回车直接提交了。。。)
就如README中的最后关于HoC的例子:https://github.com/ecomfe/react-track#%E9%AB%98%E9%98%B6%E7%BB%84%E4%BB%B6-1

const track = action => {
    const options = {
        eventPropName: 'on' + action[0].toUpperCase() + action.slice(1),
        category: 'navigation',
        action: action,
        label: null // 此处label期望值应为NavItem的name prop
    };
    
    return trackEvent(options);
};

我们会期望label的值为 NavItem的其中一个prop: name。但实际并不能取到,所以这个HoC的应用场景是有局限的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant