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
I'm trying to integrate with reactjs-autocomplete.
If I use the direct integration (autocomplete in module AutoComplete below), it kind of works. The things that don't seem to work so well may work better when it's mounted as a FunctionComponent (using autocompleteF in the same module).
However, the props list now throws a runtime TypeError at the call to keyValueList, and I can't see why. You can still take the head/tail, and the same call to keyValueList works just fine when called from the plainer autocomplete.
div [][
AutoComplete.autocompleteF [
Items [|{ Label ="HelloX"};{ Label ="WorldX"}|]
Value "HelloX"
RenderItem (fun item -> div [][ str item.Label ])
GetItemValue (fun item -> item.Label)//OnChange (fun e v -> Select v |> dispatch)]]
The text was updated successfully, but these errors were encountered:
davedawkins
changed the title
Lists passed through FunctionComponent.Of() upset _createForOfIteratorHelper
Lists passed through FunctionComponent.Of() upsets _createForOfIteratorHelper
Aug 15, 2020
Here's a workaround, in the form of makeList. Weird that it fixes things, but I think some magic/metadata has been lost from props after being passed through ReactJS
// Duplicates list-like object to give it back iteration capability// Workaround for issue logged against fable reactlet recmakeList list =match list with|[]->[]| x::xs -> x ::(makeList xs)letautocompleteF2<'Item>=
FunctionComponent.Of((fun(props : AutoCompleteProps<'Item>list)->letpropsObj=(keyValueList CaseRules.LowerFirst (makeList props))
propsObj?menuStyle <- keyValueList CaseRules.LowerFirst menuStyle
div [][
ofImport "default""react-autocomplete" propsObj []]),"autocompleteView", memoEqualsButFunctions)
I'm trying to integrate with reactjs-autocomplete.
If I use the direct integration (
autocomplete
in module AutoComplete below), it kind of works. The things that don't seem to work so well may work better when it's mounted as a FunctionComponent (usingautocompleteF
in the same module).However, the props list now throws a runtime TypeError at the call to keyValueList, and I can't see why. You can still take the head/tail, and the same call to keyValueList works just fine when called from the plainer
autocomplete
.This is how the call to
autocompleteF
is definedThe text was updated successfully, but these errors were encountered: