Skip to content

Commit

Permalink
Unflatten property list to support flattened props
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeeren committed Jan 25, 2020
1 parent 27be389 commit 6f2d489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Feliz.Generator.MaterialUI/ApiParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ let parseApi () =
ComponentApi.create "Feliz.MaterialUI" "Mui"
|> ComponentApi.addComponent themeProvider
|> ComponentApi.addComponents (components |> List.map (fun c -> c.GeneratorComponent))
|> ComponentApi.setParseProps "createObj !!properties |> Flat.flat.unflatten"

{
GeneratorComponentApi = api
Expand Down
4 changes: 2 additions & 2 deletions src/Feliz.MaterialUI/Mui.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ module MuiHelpers =
import "createElement" "react"

let createElement (el: ReactElementType) (properties: IReactProperty seq) : ReactElement =
reactElement el (createObj !!properties)
reactElement el (createObj !!properties |> Flat.flat.unflatten)

let createElementTag (tag: string) (properties: IReactProperty seq) : ReactElement =
reactElementTag tag (createObj !!properties)
reactElementTag tag (createObj !!properties |> Flat.flat.unflatten)

[<Erase>]
type Mui =
Expand Down

0 comments on commit 6f2d489

Please sign in to comment.