Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions docs/faq/faq-felizandfable.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ For example:

```fsharp
h1 [ Style [ Color "Tomato" ] ] [
p [] [ text [ Value "Hello" ] [] ] // no props
p [] [ text [ Value "Another paragraph" ] [] ] // no props
p [] [ str "Hello" ] // no props
p [] [ str "Another paragraph" ] // no props
h2 [ Style [ Color "Blue" ] ] [] // no child elements
]
```
Expand All @@ -32,7 +32,7 @@ Html.h1 [
prop.style [ style.color "Tomato" ]
prop.children [
Html.p [ prop.text "Hello" ]
Html.p [ prop.text "Another paragraph" ]
Html.p "Another paragraph"
Html.h2 [ prop.style [ style.backgroundColor "Blue" ] ]
]
]
Expand All @@ -54,12 +54,8 @@ Html.h1 [ // not fine - can't mix and match attributes and elements
prop.style [ style.color "Tomato" ]
Html.p [ prop.text "Hello" ]
]
```

In order to allow both attributes and elements in the same list, Feliz introduces the `children` node:

```fsharp
Html.h1 [ // this is now fine
Html.h1 [ // fine, adding props, and adding children using prop.children
prop.style [ style.color "Tomato" ]
prop.children [ Html.p [ prop.text "Hello" ] ]
]
Expand All @@ -68,6 +64,7 @@ Html.h1 [ // this is now fine
## Guidance
* Fable.React was created initially, whilst Feliz was developed some time later.
* Feliz has better support for React interop and the majority of the community nowadays uses the Feliz DSL style for developing components.
* As they are both wrappers around the same underlying technology (React) and Feliz uses some parts of Fable.React, you can actually mix and match the two in your applications as required.
* Fable.React and Feliz can be mixed into your application if required (for progressive migration for example)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fable.React and Feliz can be mixed into your application if required (for progressive migration for example)
* Fable.React and Feliz can be mixed together in your application if required (for progressive migration for example)

"Mixed into" doesn't necessarily imply mixed together, so I'd make this clearer.



* Also see [My journey with Feliz | A comparison between Fable.React and Feliz](https://github.com/Zaid-Ajaj/Feliz/issues/155).
7 changes: 7 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ extra:
analytics:
provider: google
property: G-WED2S9FLSL
consent:
title: Cookie consent
description:
We use cookies to recognise your repeated visits and preferences, as well
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better.

nav:
- Home: "index.md"
Expand Down