Closed Lafa02 closed 1 year ago
@Lafa02
The parameter type of the function component Hello.react.tsx
seems to be incorrect. The parameter of the function component accepts a object, not a string.
I think the correct code should be as follows:
const HelloReact = ({name}) => { return <div>Hello {name}, I am a React component</div>; }
Then, I also noticed that the error message also mentioned found object with keys {name, children},...
, which means that the parameter name
of the incorrect react function component you provided earlier is actually a Object, not a string, this object contains two keys name
and children
, this object cannot be rendered directly, you should render the name
property of this object.
I'm so stupid, sorry, thank you so much!
Hi I'm trying to use some tsx components inside my react app, but the console gives me a weird error
Note: I'm using quasar with vue my Hello.react.tsx import React from 'react';
export default const HelloReact = (name: string) => { return <div>Hello {name}, I am a React component</div>; }
my app.vue `this is my """webpack""": `
and this is the error I'm doing something wrong for sure, but I have no idea what