0

I'm trying to store the return of a react component in a variable so I can later use it to implement a search of the variable content: For example:

const myComponent = (props) => (
<div><span>my name is  {props.name}</span></div>

)

then I would like to do the following:

const resultForSearch = <myComponent name="bob"/>
console.log(resultForSearch ) // would be : my name is  bob
2

0

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.