Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sutil fails with Child not found when transitionning from Html.parse to a real SutilElement #94

Open
MangelMaxime opened this issue Sep 29, 2024 · 0 comments

Comments

@MangelMaxime
Copy link
Contributor

type Reproduction =
    | Case1
    | Case2

let app () =
    let state = Store.make Reproduction.Case1

    Html.div [
        Bind.fragment
            state
            (fun state ->
                match state with
                | Reproduction.Case1 ->
                    Html.parse "This is case 1"

                | Reproduction.Case2 ->
                    Html.div [
                        Html.text "This is case 2"
                    ]
            )

        Html.button [
            Ev.onClick (fun _ -> Store.set state Reproduction.Case2)
            prop.text "Go to case 2"
        ]
    ]

CleanShot 2024-09-29 at 21 54 47

My suspicion is that Html.parse does not create a child but set innerHtml or something like that. I think the access to child in the replaceChild function should be protected.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant