adelarsq / Feliz.ReactNative

React Native bindings for Feliz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feliz.ReactNative Nuget Publish on NuGet

React Native bindings for Feliz

Usage:

module App

open Feliz
open Feliz.ReactNative

[<ReactComponent>]
let Counter() =
    let (count, setCount) = React.useState(0)
    Comp.view [
        Comp.text [
            prop.style [
                style.width 50.
                style.height 50.
                style.backgroundColor "red"
            ]
            prop.onPress (fun _ -> setCount(count + 1))
            prop.text "Increment"
        ]

        Comp.text [
            prop.style [
                style.width 50.
                style.height 50.
                style.backgroundColor "blue"
            ]
            prop.onPress (fun _ -> setCount(count - 1))
            prop.text "Decrement"
        ]

        Comp.text (count |> string)
    ]

About

React Native bindings for Feliz

License:MIT License


Languages

Language:F# 100.0%