-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Fable 5 and feliz > 3.0 breaks the bindings with the new implementation of react children for react 19
reactElementWithChild and more are removed, but can be written like this:
Source: fable-hub/Feliz#652
module ReactHelper =
let inline reactElementWithChild (name: string) (child: 'a) =
React.createElement(
name,
createObj [ ],
ResizeArray([!!child])
)
let inline reactElementWithChildren (name: string) (children: #seq<ReactElement>) =
React.createElement(
name,
createObj [],
!!children
)
let createElement name (properties: IReactProperty list) : ReactElement =
match properties |> List.partition (fun (key, _) -> key <> "children") with
| props, ["children", children] ->
React.createElement(
name,
createObj props,
!!children
)
| props, _ ->
React.createElement(
name,
createObj props,
ResizeArray()
)There might be a bigger migration job, depending on what aim is taken. Recreating the helper functions would be a drop-in solution that should work out of the box.
Metadata
Metadata
Assignees
Labels
No labels