-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
JSX - Slots reactivity is not supported #9109
Comments
Try {{
-- text: useSlot.value ? () => 'slot value' : undefined,
++ text: () => (useSlot.value ? 'slot value' : undefined),
}} Maybe relate to #6484 |
In this case, the slot will always be available in the Indeed, we can perform the slot function and check if something is returned, but this entails additional checks and an increase in the amount of code Most likely it really refers to the issue #6484 Is the proposed merge expected? |
@sxzz, @baiwusanyu-c, please take a look at #6484 for final approval 🥺🥺🥺 |
Vue version
3.3.4
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-t9skwh?file=src%2FApp.tsx
Steps to reproduce
Click "Toggle useSlot" button
What is expected?
Slot reactivity supported
What is actually happening?
Slots reactivity is not supported
System Info
No response
Any additional comments?
Sometimes there is a need to transfer a slot to the component, depending on the reactive value.
In the syntax of SFC templates, this can be done as follows:
But when I try to do something like this in JSX, it lose the ability to reactively control the transfer of the slot to the component:
What to do in such a situation?
The text was updated successfully, but these errors were encountered: