Skip to main content

Fragment

Check out the official React docs!

For more detailed information about React concepts and APIs, please refer to the official documentation for Fragment.


Fragment lets you group multiple elements without adding extra nodes to the DOM.

[<ReactComponent(true)>]
let FragmentDemo() =
React.Fragment [
// ... grouped elements
]

This is a heading inside a fragment

Fragments let you group multiple elements without adding extra nodes to the DOM.

Rightclick and inspect me to see I do not have a parent.

Show code
module Example.Fragment

open Feliz

[<ReactComponent(true)>]
let FragmentDemo() =
React.Fragment [
Html.h3 [ prop.text "This is a heading inside a fragment" ]
Html.p [ prop.text "Fragments let you group multiple elements without adding extra nodes to the DOM." ]
Html.button [ prop.text "Click me" ]
Html.p [ prop.text "Rightclick and inspect me to see I do not have a parent." ]
]