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

Bug: not supporting vue tsx #4450

Closed
1 task
X-Jagger opened this issue Aug 24, 2022 · 3 comments · Fixed by #4897
Closed
1 task

Bug: not supporting vue tsx #4450

X-Jagger opened this issue Aug 24, 2022 · 3 comments · Fixed by #4897
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: vue Related to Vue (scope)

Comments

@X-Jagger
Copy link

What version of astro are you using?

^1.0.8

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

pnpm

What operating system are you using?

mac

Describe the Bug

error: Cannot read properties of undefined (reading '0')

please check the reproducible example

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-v6q6m9?file=src%2Fpages%2Findex.astro,src%2Fcomponents%2FCounter.tsx&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@matthewp matthewp added - P3: minor bug An edge case that only affects very specific usage (priority) s3-large pkg: vue Related to Vue (scope) labels Aug 24, 2022
@matthewp
Copy link
Contributor

@bluwy this might be a big one so let's chat about it before you begin.

@bluwy
Copy link
Member

bluwy commented Sep 27, 2022

Yeah this seems like a big feature request, but I can see if a vue-jsx integration is possible. (or combined)

@bluwy
Copy link
Member

bluwy commented Sep 29, 2022

Added support for JSX in the next minor release of @astrojs/vue with the jsx: true option. Note the supported syntax (also recommended in the Vue docs) is something like:

export default defineComponent({
   props: {
     start: {
       type: String,
       required: true
     }
   },
   setup(props) {
     const count = ref(parseInt(props.start))
     return () => (
       <div>{count.value}</div>
     )
   },
 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: vue Related to Vue (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants