Your idea already was suggested/discussed since this message and in short it gives no type-safety, because you end up with size :: String
which people will use and not size :: ButtonSize
. Trying to hide RawProps
(and hence size :: String
) was also discussed further below and would, in short, result in you having to go through FFI to create a function-converter, at which point we turn full circle back to my idea that started this whole topic.
Actually, maybe you’re right. I just realized I was missing the nuance that I could create unique converter function for each component, which wouldn’t require FFI. I mean, I could implement ButtonProps -> RawProps
, then CheckBoxProps -> RawProps
, etc. All of them to be hidden, of course.
I am not quite sure why didn’t I think that way… I will look at it.
@wclr so, I tried implementing it the native way, but couldn’t get past compilation error, which I decided to post separately to not clutter this discussion. Please see if you understand what’s that about, because I’ve spent some time on this and have no slightest idea what the compiler wants from me…