Skip to content

Passing list of objects to react props issue .find > usually using an FSharpList instead of a regular js array #634

@jkone27

Description

@jkone27

note: Array [| ... |] has to be used when passing down collection of objects as props in ReactComponents

while working with Fable/Feliz i notice that if i need to pass to props a list of objects in js, it only works if i use the array construct in F# , but not regular list construct

image

fix/workaround

most react libraries work with standard js [ ... ] of props, not FSharpList type, so you can cast using Seq.toArray or just using [| ... |] when you need to pass arrays to JS

Interop with other Fable/Feliz components

ofc if a component relies on FSharpList types, it would not work, so i undertsand this limit and not sure what's the right approach...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions