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

Do refs... actually exist? #143

Open
YCMitch opened this issue Aug 31, 2018 · 1 comment
Open

Do refs... actually exist? #143

YCMitch opened this issue Aug 31, 2018 · 1 comment

Comments

@YCMitch
Copy link

YCMitch commented Aug 31, 2018

I can see a few posts raised here about innerRef vs inputRef, but in my experience neither of those seem to exist. Is there an issue with my code, or does the component not actually expose any ref?

I've tried:
<AutosizeInput innerRef={ref => this.inputRef = ref} /> <AutosizeInput inputRef={ref => this.inputRef = ref} />

Both times, this.inputRef is undefined.

@Slooowpoke
Copy link

I know this is late, but I had a little struggle with this too. In the end I wrote
inputRef={node => this.input = node}.

I did have to create the ref beforehand?
this.input = React.createRef();

Perhaps this was the crux of your issue, or maybe the package changed since this issue was raised.

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

2 participants