njlr / feliz-ce

Replace React Hooks with higher-order components (HoCs) and Computation Expressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feliz.CE

Experimental Computation Expression for Feliz, as an alternative to React Hooks.

let counter initialCount =
  react {
    let! count, setCount = React.withState initialCount

    return
      Html.div
        [
          Html.h1 $"Count: {count}"
          Html.button
            [
              prop.text "Increment"
              prop.onClick (fun _ -> setCount (count + 1))
            ]
        ]
  }

About

Replace React Hooks with higher-order components (HoCs) and Computation Expressions


Languages

Language:F# 100.0%