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

this is undefined in componentDidUpdate #16

Closed
erin-doyle opened this issue May 26, 2017 · 1 comment
Closed

this is undefined in componentDidUpdate #16

erin-doyle opened this issue May 26, 2017 · 1 comment
Labels

Comments

@erin-doyle
Copy link
Collaborator

I've found that in a 3rd party component I'm using, in an application where I'm also using react-a11y-alt, this is coming up as undefined in the componentDidUpdate() function. Using the component in other places does not have this issue.

It looks as if the react-a11y-alt after.js render() function patches componentDidUpdate as well as componentDidMount and when it does so it replaces the context with undefined:

original.apply(undefined, args);

It looks as if the component's context is available there and could be passed in as the thisArg instead of undefined, so I'm not sure why that isn't being done.

@erin-doyle erin-doyle added the bug label May 26, 2017
@erin-doyle
Copy link
Collaborator Author

Correction. The actual source code is:

original.apply(this, args);

It was only being transpiled from this to undefined. This looks to be a babel issue.

erin-doyle pushed a commit that referenced this issue May 30, 2017
erin-doyle pushed a commit that referenced this issue Oct 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant