You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the README for this repo it showcases using FFI to import a react class, but the class being imported just uses the default props which are already defined by Concur.React.Props. I'm curious how to import a class that uses some custom props (for example, React Datepicker which has all sorts of other props like onChange :: JSDate -> Effect Unit and minDate :: JSDate that one wouldn't find in Concur.React.Props). How would one go about defining FFI for something like that? Maybe that could be included in the docs somewhere? I feel like importing React classes that have custom props is a pretty common use case.
The text was updated successfully, but these errors were encountered:
A bit of a late reply, but here is how I did a custom prop ffi for an ant design input box, which has a custom prop suffix which takes a JSX argument and renders it on the right hand side inside the input.
input :: El
input = el' (unsafeCreateElement _input <<< unsafeFromPropsArray)
suffix :: forall a. ReactElement -> ReactProps a
suffix = PrimProp <<< unsafeMkProps "suffix"
Then just go ahead and use suffix like a normal prop in the props array.
In the README for this repo it showcases using FFI to import a react class, but the class being imported just uses the default props which are already defined by
Concur.React.Props
. I'm curious how to import a class that uses some custom props (for example, React Datepicker which has all sorts of other props likeonChange :: JSDate -> Effect Unit
andminDate :: JSDate
that one wouldn't find inConcur.React.Props
). How would one go about defining FFI for something like that? Maybe that could be included in the docs somewhere? I feel like importing React classes that have custom props is a pretty common use case.The text was updated successfully, but these errors were encountered: