Franco
05/20/2020, 9:25 PMchadmorrow
05/20/2020, 9:32 PMget() = definedExternally; set(value) = definedExternally
to the var value: String
in your interface? That's the only thing I can see that looks different from the wrappers I've made for other js libraries beforeFranco
05/20/2020, 9:38 PMOnly nullable properties of external interfaces are allowed to be non-abstract
Should I make the interface non external?chadmorrow
05/20/2020, 9:39 PMvalue
nullablechadmorrow
05/20/2020, 9:39 PMvar value: String? get() = definedExternally; set(value) = definedExternally
Franco
05/20/2020, 9:40 PMnull
?Franco
05/20/2020, 9:41 PMchadmorrow
05/20/2020, 9:42 PMFranco
05/20/2020, 9:42 PMchadmorrow
05/20/2020, 9:42 PMFranco
05/20/2020, 9:43 PMchadmorrow
05/20/2020, 9:43 PMFranco
05/20/2020, 9:43 PMchadmorrow
05/20/2020, 9:43 PMIlya Goncharov [JB]
05/20/2020, 9:43 PMFranco
05/20/2020, 9:44 PMIlya Goncharov [JB]
05/20/2020, 9:47 PMonChange
props in your interfaceIlya Goncharov [JB]
05/20/2020, 9:47 PMchadmorrow
05/20/2020, 9:47 PMIlya Goncharov [JB]
05/20/2020, 9:50 PMvar value by useState(โโ)
And the to use it as simple var, not as pair value
and setValue
https://github.com/JetBrains/kotlin-wrappers/blob/master/kotlin-react/README.md#the-usestate-hookFranco
05/20/2020, 9:51 PMFranco
05/20/2020, 9:52 PMFranco
05/20/2020, 9:56 PMFranco
05/20/2020, 10:07 PMvalue
in TextField
is actually set through a property rather than directly through its state
, but that should be fine as the value passed to the property is in the state of the parent component.Franco
05/20/2020, 10:11 PMonChange
property, that is in the full code I shared on the issue @Ilya Goncharov [JB]Franco
05/20/2020, 10:20 PMchadmorrow
05/20/2020, 10:21 PMFranco
05/20/2020, 10:21 PMFranco
05/20/2020, 10:39 PMvar resultSelected by useState("")
but I get the error:
Type 'Pair<TypeVariable(T), RSetState<TypeVariable(T)> /* = (TypeVariable(T)) -> Unit */>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Franco
05/20/2020, 10:46 PMchadmorrow
05/20/2020, 10:55 PMchadmorrow
05/20/2020, 11:00 PMFranco
05/20/2020, 11:13 PMchadmorrow
05/20/2020, 11:16 PMFranco
05/20/2020, 11:16 PMWarning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: <https://fb.me/react-controlled-components>
Franco
05/20/2020, 11:18 PMchadmorrow
05/20/2020, 11:19 PMFranco
05/20/2020, 11:21 PMFranco
05/20/2020, 11:25 PMTextField
becomes "controlled" because I'm setting the value
I have to update the value inside the onChange
callback. I was using this callback to send the value up to the parent component but I was not updating the text field state.
Thanks for the help @chadmorrow and @Ilya Goncharov [JB]!Ilya Goncharov [JB]
05/21/2020, 7:20 AMFranco
05/21/2020, 9:13 AMpre-104
but I also tried pre105
and the same error appeared.Ilya Goncharov [JB]
05/21/2020, 9:19 AMFranco
05/21/2020, 9:23 AMIlya Goncharov [JB]
05/21/2020, 9:45 AMturansky
05/21/2020, 9:51 AMimport react.getValue
import react.setValue
turansky
05/21/2020, 10:16 AM