eslint-plugin-immutable
eslint-plugin-immutable copied to clipboard
Refs and Functional Components
Hi. I very like this plugin, but I got stack while trying to make immutable getting of reference on native element.
Official react documentation says You may not use the ref attribute on functional components
Any idea hot wo accomplish that immutable way? Or if it's impossible, I would like to have an option in this plugin to be allow such cases. Any chance for that?
Functional components aren't the same as native/DOM components; you can still use ref
on a DOM component. Why do you need one on an SFC?
My point was, that I can get ref
only within a class by assigning it to some property of this
or to some let
variable. In both cases - it's not allowed by plugin. I need ref
to pass an element to en external lib.