Andrew
04/07/2020, 5:02 AMIlya Goncharov [JB]
04/07/2020, 6:42 AMRState
interface effectively external interface, because use plain javascript object. And react can modify this object, as it wants. So it have additional functions only if they have it in real JavaScript world.
You can declare this function as a extension function.
Something like
fun RYourState.someFunction(someValue: Type): Type {
...
}
spand
04/07/2020, 7:26 AMAndrew
04/07/2020, 2:52 PMspand
04/08/2020, 2:49 PMspand
04/08/2020, 2:51 PMfun setState(transformState: (S) -> S, callback: () -> Unit = _definedExternally_)