I'm not sure how we could avoid this, and I've already patched my code to put the state a layer higher than the component definition, but thought I would share.
I have a customized TextInput that saves off a ref of the input on the instance. Renders something like:
<input
ref='input'
label='a string i need translated'
... />
And when that custom component is used with makeLocalizedElement:
I'm not sure how we could avoid this, and I've already patched my code to put the state a layer higher than the component definition, but thought I would share.
I have a customized TextInput that saves off a
ref
of theinput
on the instance. Renders something like:And when that custom component is used with makeLocalizedElement:
I get warned by React that I can't have a
ref
on the stateless functional component (theLoc
returned bymakeLocalizedElement
)Could we add something to makeLocalizedElement, maybe a flag, that it would branch on and instead create a stateful component?