Hi, what is the Kotlin idiomatic way to translate...
# javascript
f
Hi, what is the Kotlin idiomatic way to translate javascript spread operator as used in React to spread props in a component ?
1
m
Object.assign(this, params) or +params
🙌 1
f
thanks, in order to use "+params" do I need to implement the React.props interface ?
m
Yes, the
+
is an operator override on the react props interface 🙂
🙌 1
This is an example on how we use it with an MUI
Autocomplete
component
🙌 1
f
ok.. perfect I have developed a small library to use ReactHookForm and MUI components in kotlinjs thank to you now I've added +field.props syntax sugar :-)
👍🏼 1