Hi. I am facing problem. It seems that Fabulous does not set ViewRef value when ViewRef is changed. There is simple repro:
type Model = { LabelRef: ViewRef<Label> }
type Message =
| ResetViewRef
| UpdateText
let update msg model =
match msg with
| ResetViewRef ->
{ model with LabelRef = ViewRef<_>() }, Cmd.none
| UpdateText ->
model.LabelRef.TryValue |> Option.iter (fun x -> x.Text <- "Hello, world from ref!")
model, Cmd.none
let view model dispatch =
View.StackLayout(
orientation = StackOrientation.Vertical,
children = [
View.Label(
text = "Hello, world!",
ref = model.LabelRef
)
View.Button(
text = "Update ref",
command = (fun _ -> dispatch ResetViewRef)
)
View.Button(
text = "Update text via ref",
command = (fun _ -> dispatch UpdateText)
)
])
Hi. I am facing problem. It seems that Fabulous does not set
ViewRef
value whenViewRef
is changed. There is simple repro:Repro steps
Expected behavior
Text changed to "Hello, world from ref!"
Actual behavior
Text does not change.