open BsReform; open Antd.Grid; module FormConfig = [%lenses type state = {guesstimatorString: string}]; module Form = ReForm.Make(FormConfig); let schema = Form.Validation.Schema([||]); module FieldString = { [@react.component] let make = (~field, ~label) => { E.ste}> validate()} /> } />; }; }; module Styles = { open Css; let dist = style([padding(em(1.))]); let spacer = style([marginTop(em(1.))]); }; module DemoDist = { [@react.component] let make = (~guesstimatorString: string) => { let (ys, xs) = DistEditor.getPdfFromUserInput("normal(1, 1) / normal(10, 1)"); let continuous: DistTypes.xyShape = {xs, ys}; E.ste}>
; }; }; [@react.component] let make = () => { let reform = Form.use( ~validationStrategy=OnDemand, ~schema, ~onSubmit=({state}) => {None}, ~initialState={guesstimatorString: "normal(1, 1) / normal(10, 1)"}, (), ); let demoDist = React.useMemo1( () => { }, [|reform.state.values.guesstimatorString|], );
demoDist
E.ste}>
; };