-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
child component is not re-rendered when prop is updated from parent AND no default slot is provided #1206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is expected from your code. You create the So the Solution: move that line into the setup(props, {slots, emit}) {
return {
children: () => {
const vnodes = slots.default ? slots.default() : []
vnodes.forEach((vnode) => { |
@LinusBorg thanks for the comment. If you take a look at #1186, I moved it out of the children function as a workaround. That's why I said
My question then becomes is there a way to get both #1186 and this ticket to work? If not could you please reopen this ticket in case there's a fix for it? |
There is no fix for this in the context of this bug report, so I won't re-open. By moving the line into I'd rather suggest you join us on the forum or the chat and formulate clear description of the challenge you are intending to solve parsing vnodes like that. I for one usually refrain from that as it doesn't scale well and instead use provide/inject to communicate state between composite components like that. |
Version
3.0.0-beta.14
Reproduction link
https://codepen.io/lzhoucs/pen/GRpwwwK
Steps to reproduce
What is expected?
The tab clicked should render its active prop as true
What is actually happening?
The tab renders its initial active prop value false and never re-renders after being clicked
The code is in the demo is from the last state of #1186 with slight variation. To summarize:
The only difference between the two demos above is the default slot. e.g:
vs
The text was updated successfully, but these errors were encountered: