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

domPropsInnerHTML does not work in tsx #1810

Closed
beary opened this issue Aug 8, 2020 · 3 comments · Fixed by #1814
Closed

domPropsInnerHTML does not work in tsx #1810

beary opened this issue Aug 8, 2020 · 3 comments · Fixed by #1814

Comments

@beary
Copy link
Contributor

beary commented Aug 8, 2020

Version

3.0.0-rc.5

Reproduction link

https://codesandbox.io/s/wonderful-kepler-tmim6?file=/src/App.tsx:189-240

Steps to reproduce

Create a vite project and pass the domPropsInnerHTML property to a component in tsx

What is expected?

Use domPropsInnerHTML to render html.

Related document: https://github.com/vuejs/jsx#directives

What is actually happening?

domPropsInnerHTML do not render anything.

@sqal
Copy link
Contributor

sqal commented Aug 8, 2020

There's no longer { domProps: { innerHTML: '' } } or any other nested values in vnode data structure, instead vnode now receives flat props object, so simply replace it with innerHTML

Related RFC - https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md#flat-vnode-props-format

Types needs to be updated though https://github.com/vuejs/vue-next/blob/73807aeaf72ab102510f9a9dfa1dcc21c11bf23a/packages/runtime-dom/types/jsx.d.ts#L249

@beary
Copy link
Contributor Author

beary commented Aug 8, 2020

Thanks! It works, I'll create a pull requests to update jsx.d.ts

@fanquan
Copy link

fanquan commented Feb 24, 2021

Thanks! It works, I'll create a pull requests to update jsx.d.ts

How to update jsx.d.ts

@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants