JavaScript Can you use jsx within template string in React render props? template string within template string

Is it possible to put JSX inside a template string that is being used as a React render prop?

This is what I'm trying to do, but it leads to the link rendering as [object Object]

const Container = ({ message }) => <div className="from line 4"> {message}</div>;
const Link = () => <a target='_blank' href="#">juan</a>;

const App = () => (
  <div>
    <Container message={`My message with a ${<Link />}`} />
  </div>
);

One thing I tried was to put JSX instead of a template string inside message. This works, but it introduces a new div that isn't needed.

<Container
  message={<div>My message {<Link />}</div>}
/>

I made this codesandbox to illustrate the problem

Answer:1

I'm using the Object.assign() to copy values to an object: const { one, two, three } = attributes; return Object.assign( props, { "data-one": one, "data-two": two, "data-three": three } ); ...

I'm using the Object.assign() to copy values to an object: const { one, two, three } = attributes; return Object.assign( props, { "data-one": one, "data-two": two, "data-three": three } ); ...

I have a problem I am sitting on for the past few days. I want to write an optimal (in JS) program for verifying if a number is a Palindrome. My current approach: function isPalidrom2(pali){ ...

I have a problem I am sitting on for the past few days. I want to write an optimal (in JS) program for verifying if a number is a Palindrome. My current approach: function isPalidrom2(pali){ ...

I have an web project where I'd like to animate the opacity of five colored divs causing them to "blink" in sequence, and the user would then click on them in the same order (like Simon says). The ...

I have an web project where I'd like to animate the opacity of five colored divs causing them to "blink" in sequence, and the user would then click on them in the same order (like Simon says). The ...

so I have a time-stamp function in a javascript file that return a date that look like MM/DD/YY I would like tom import what the function return into another script ( node.js) and display it whenever ...

so I have a time-stamp function in a javascript file that return a date that look like MM/DD/YY I would like tom import what the function return into another script ( node.js) and display it whenever ...