docs: Affix - don't include arrow-functions inside component props; use refs instead #4037
Labels
help wanted
The suggestion or request has been accepted, we need you to help us by sending a pull request.
In /components/affix doc, I see this bad practice:
What's wrong with this:
() => { return (
is pointless noise. Say() => (
instead.getElementById
to directly reference an element rendered in the same component. Huge bad-practice. This is what refs are for: https://facebook.github.io/react/docs/refs-and-the-dom.html<Affix target
. This was popular a year ago, but is considered bad-practice now, and violates many eslint rules. Using a ref properly will fix this too.The text was updated successfully, but these errors were encountered: