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

handle focus when BaseComponent is an object #66

Closed
akutch opened this issue Apr 18, 2019 · 3 comments
Closed

handle focus when BaseComponent is an object #66

akutch opened this issue Apr 18, 2019 · 3 comments
Assignees

Comments

@akutch
Copy link

akutch commented Apr 18, 2019

In cases where we useforwardRef, forwardRef returns an object rather than a react class/function. This means that BaseComponent.prototype is undefined and causes the following error:

Screen Shot 2019-04-18 at 10 37 16 AM

@aem aem self-assigned this Apr 18, 2019
@FranDias
Copy link

Screenshot 2019-04-18 10 56 38

😮

@Friss
Copy link
Member

Friss commented Apr 27, 2019

I just ran into this in a side project and while adding a check for BaseComponent.prototype would work the other problem is that we still always set a ref.

We could make that conditional as well in the case of an arrow function component. I tried briefly looking into using React.forwardRef but I think that opens a big can of worms.

@aem
Copy link
Contributor

aem commented May 13, 2020

fixed in #83

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

4 participants