sorry if this question has already been answered, ...
# react
g
sorry if this question has already been answered, but I'm using the Kotlin/Js inspection plugin and in the generated Kotlin/React project it is saying that the data class which extends state should be an external interface. The most up to date docs show it as a data class. Is the inspection plugin lagging behind the most up to date docs or should it really be an external interface?
t
Plain JSO is preferred, for props and state Otherwise behaviour is unexpected
Also function components are preferred (future is here)
g
Ok thanks. Whats the current recommended way for creating a plain js object in Kotlin?
t
In most cases it would be hidden, like here:
Copy code
attrs {
   q = 10
}
For other cases -
jso
factory method:
Copy code
val props: MyProps = jso {
    q = 10
}
Also you can create custom factory method, when you have many required properties