3 ms·
> Writing the react-bindings took me an hour,... Do you mean generic 'use react in kotlin' bindings? If so, have you published them or would you consider doin
by deckiedan 9y ago
> Writing the react-bindings took me an hour,...
Do you mean generic 'use react in kotlin' bindings? If so, have you published them or would you consider doing so?
- cel1ne 9y agoYes. I have not published them, because a) they use the same method names like the `kotlin-html` package ("div{}" et. al.), only they create ReactElement instead of manipulating the dom. This could be confusing. b) The type-safe scoping mechanism, so that each scope has it's correct prop-setters and won't inherit setters from a scope further up is rather complex. It uses extension methods with multiple receivers plus operator overrides for `invoke()`. That is rather complicated to follow so I want to try it out for some time to check if there's confusion or subtle bugs. c) I haven't optimised for (allocation-)performance yet. d) I'm using an early-access version of kotlin 1.1.4 which isn't out yet.
- boubiyeah 9y agoIf it only took an hour, it can't be very type-safe / comprehensive.
- cel1ne 9y agoHere is a good tutorial if you'd like to try it yourself: https://kotlinlang.org/docs/reference/type-safe-builders.html https://kotlinlang.org/docs/reference/type-safe-builders.htm...
- deleted 9y ago[deleted]