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

ElementsConsumer.propTypes - func undefined #33

Closed
danseaman6 opened this issue Feb 7, 2020 · 0 comments · Fixed by #35
Closed

ElementsConsumer.propTypes - func undefined #33

danseaman6 opened this issue Feb 7, 2020 · 0 comments · Fixed by #35
Assignees

Comments

@danseaman6
Copy link

Working with react-stripe-js and stripe-js betas, I'm getting the following error when trying to load up my webapp that uses stripe:

Uncaught TypeError: Cannot read property 'isRequired' of undefined

The offending line appears to be:

/**
 * @docs https://stripe.com/docs/stripe-js/react#elements-consumer
 */
const ElementsConsumer = ({ children, }) => {
    const ctx = useElementsContextWithUseCase('mounts <ElementsConsumer>');
    // Assert to satsify the busted React.FC return type (it should be ReactNode)
    return children(ctx);
};
ElementsConsumer.propTypes = {
    children: __exports.func.isRequired,  <-- ERROR FROM HERE
};

Based on what @christopher-stripe linked in the TypeScript issue, maybe this comes from that commonjs namedExports? Let me know if anything pops out to you guys.

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

Successfully merging a pull request may close this issue.

3 participants