I want my
information {body.test2}
to show up and say information about me. Why can’t i do it like i did it? And what do i have to do?I want my
information {body.test2}
to show up and say information about me. Why can’t i do it like i did it? And what do i have to do?Hm i myself recently started with react so im not 100% on it… But i think you’re using properties the wrong way, you can only pass “props” for properties, which is object from which you grab all your data.
Like this:
const MediaCard = (props) => (
<div>
<h2> Hello {props.test1} </h2>
<p> information {props.test2} </p>
</div>
);
ReactDOM.render(
<MediaCard test1="me" test2="about me" />,
document.querySelector("#root")
);
You pass just props object instead of title and body and acces data from it as you would from title and body.
Ye i know about that thought i could do it this way too. Thanks