Can't parse component composition - only functions props
YossiSaadi opened this issue · comments
Reproduce:
https://codesandbox.io/p/sandbox/react-jsx-parser-1-29-0-component-composition-b-53qnmd
const jsx = `<Button someComponent={Component}>I'm children</Button>`
...
<JsxParser components={{ Button, Component }} jsx={jsx} />
const Button = ({ someComponent, children }) => {
return <button>{someComponent || children}</button>;
};
...
const Component = () => {
return <div>I'm some component</div>;
};
Yes, that is somewhat strange behavior - but I'm not sure why you would expect the Component to render. You neither rendered it nor invoked it.