Skip to content

Instantly share code, notes, and snippets.

View jwosty's full-sized avatar

John Wostenberg jwosty

View GitHub Profile
@jwosty
jwosty / DragDropPage.fs
Last active January 31, 2021 01:42 — forked from JordanMarr/DragDropPage.fs
Fable bindings for "react-dnd" using HTML5 provider
type Language = {
Name: string
}
let draggableLanguage = FunctionComponent.Of(fun (props: {| lang: Language |}) ->
let dragState, drag, preview = ReactDND.useDrag [
DragSpec.Item { ``type`` = "Language"; dragSrc = props.lang }
DragSpec.Collect (fun mon -> { isDragging = mon.isDragging() })
//DragSpec.End (fun dragItem mon -> printf "DragEnd: %A; Mon.DropTarget: %A" dragItem mon)
]