Skip to content
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

Slots reactivity is not supported #240

Closed
8 of 9 tasks
PurpleTape opened this issue Aug 26, 2023 · 1 comment
Closed
8 of 9 tasks

Slots reactivity is not supported #240

PurpleTape opened this issue Aug 26, 2023 · 1 comment

Comments

@PurpleTape
Copy link

Related plugins

Describe the bug

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:

<template>
  <Comp>
    <template #slotName v-if="someReactiveVariable">
       Slot value
    </template>
  </Comp>
</template>

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:

const render = () => (
  <Comp>
    {{
      slotName: someReactiveVariable.value ? () => 'Slot value' : undefined
    }}
  </Comp>
)

What to do in such a situation?

Reproduction

https://stackblitz.com/edit/vitejs-vite-t9skwh?file=src%2FApp.tsx

Steps to reproduce

Click "Toggle useSlot" button

System Info

"@vitejs/plugin-vue-jsx": "^3.0.2"

Used Package Manager

npm

Logs

No response

Validations

@edison1105
Copy link
Member

Closing as it can't reproduce with the latest version.
see Playground

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants