Skip to content

Instantly share code, notes, and snippets.

@lukaszkrzywizna
Created April 12, 2024 06:28
Show Gist options
  • Save lukaszkrzywizna/3bf6c9a70f7508f74adca228606553cf to your computer and use it in GitHub Desktop.
Save lukaszkrzywizna/3bf6c9a70f7508f74adca228606553cf to your computer and use it in GitHub Desktop.
module Operators
open Feliz
let inline (+@) (tag: IReactProperty list -> ReactElement) (className: string) (props: IReactProperty list) =
tag (props @ [ prop.className className ])
let inline (++) (tag: IReactProperty list -> ReactElement) (prop: IReactProperty) (props: IReactProperty list) =
tag [prop; yield! props ]
let inline (<.>) (tag: IReactProperty list -> ReactElement) (txt: string) =
tag [ prop.text txt ]
let inline (</>) (tag: IReactProperty list -> ReactElement) (children: ReactElement list) =
tag [ prop.children children ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment