2

but have some React code done and want to use it like regular Vue component. I found package Vuera, but while trying to render react components I recive an error:

Error in file /src/components/MyReactComponent.jsx:4:2

The above error occurred in the <MyReactComponent> component:
[Vue warn]: Error in mounted hook: "TypeError: (0 , _vue.createTextVNode) is not a function"
TypeError: (0 , _vue.createTextVNode) is not a function

I'm using Vue^2.6.11 and I made new project with vue create ., installed react^17.0.2, react-dom^17.0.2 and vuera^0.2.7 via npm.

This is link to sandbox with this simple setup.
What i'm doing wrong? Can someone show me the correct way?

2
  • I have tested something and if you remove the <div> tags and just return 'test' you will see that it works... it seems there is something off related to JSX. Commented Jun 12, 2021 at 22:52
  • How can use React Component in Vue Application? Commented May 7, 2024 at 14:22

1 Answer 1

3

I think what is going on is Vue doesn't know how to handle the JSX. But in general I would recommend sticking to only one framework or library and not trying to mix them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.