yew icon indicating copy to clipboard operation
yew copied to clipboard

docs: explain a workaround for `if` with typed children

Open ctron opened this issue 2 years ago • 4 comments

Description

Explains a workaround for #3256

Checklist

  • [x] I have reviewed my own code

ctron avatar Dec 13 '23 08:12 ctron

Visit the preview URL for this PR (updated for commit 23debb4):

https://yew-rs--pr3560-feature-doc-if-type-hu7h7tdk.web.app

(expires Wed, 20 Dec 2023 09:24:09 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

github-actions[bot] avatar Dec 13 '23 08:12 github-actions[bot]

Is there something missing for this PR? It's a doc only change and should be quick to merge.

ctron avatar Dec 19 '23 08:12 ctron

Thank you for your pull request.

However, I do not think this pull request will be accepted due to the issue with typed children and ChildrenRenderer itself, which is discussed in detail in #3256 and #3262. As a result, we have committed to remove Children* from most examples and no longer recommend their usage.

You can try out a slightly modified version of the code you submitted in: https://play.yew.rs/?shared=j98egT98b67VRJAGJIJu

https://github.com/yewstack/yew/assets/11693215/a7841972-967f-44f4-aedc-73956da2f732

The correct behaviour should be the input containing 3 being removed and added, however, input 1 is being toggled instead.

futursolo avatar Dec 19 '23 09:12 futursolo

So, what's the strategy on having type safe children in the future?

ctron avatar Dec 19 '23 09:12 ctron