Closed cmeeren closed 5 years ago
Quoting Announcing fable-compiler 2.2, Fable.Core 3 and more :)
The React event interfaces have been replaced with Browser.Types. Except for SyntheticEvent and FormEvent (which are just assimilated to Event), the other events have corresponding ones with same name.
I don't know for CSSProperties
Thanks, but FormEvent
doesn't seem to exist in the Browser.Types
namespace (or even at all in this repo - for the record, neither does CSSProperties
).
If I understand correctly the quotes SyntheticEvent
and FormEvent
are now Event
.
Oh, sorry, I really need to learn how to read. 😳 Thanks!
Just CSSproperties
left, then.
Because Fable.React uses union types to represent React props, ideally you should use something like Style
to accept a CSSProp
list.
If you need to get a handle of the CSSProperties object, you could use something like this:
type CSSProperties =
interface end
let inline cssProps (css: CSSProp list): CSSProperties =
keyValueList CaseRules.LowerFirst css :?> _
We're trying to make all helpers in Fable.React compatible with SSR. So it's a bit tricky to add such a function directly to this library.
Thanks! I'll defer the API decision in this particular context to the maintainer of Fable.MaterialUI, since I haven't been able to figure out how the props using CSSProperties
are intended to be used.
The following types seem to have been removed in Fable.React 5. What should be used now?
CSSProperties
FormEvent
FocusEvent