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

Use React.createRef() instead of callback ref #31

Open
tkrotoff opened this issue Aug 8, 2018 · 0 comments
Open

Use React.createRef() instead of callback ref #31

tkrotoff opened this issue Aug 8, 2018 · 0 comments

Comments

@tkrotoff
Copy link
Owner

tkrotoff commented Aug 8, 2018

See Introduction to Refs in React 16.3

Prior to React v16.3 the callback ref were the preferred way to create and use refs. [...]
If you use an inline callback function for your ref a new function is created for every re-render. This is the case with any arrow function inside the render method.
The inline callback function will also be called twice during updates. [...] the first call produces a null value before the element is return on the second call.

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

No branches or pull requests

1 participant