Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
8thApril 2nd project
<div>
<div id="d1"></div>
<div id="d2"></div>
</div>
function NewPerson(props)
{ return(
<div class="person">
<h1>{props.name}</h1>
<p>Age:{props.age}</p>
</div>
);
}
ReactDOM.render(<NewPerson name="Riya" age='18'/>,
document.querySelector('#d1'));
ReactDOM.render(<NewPerson name="Diya" age='17'/>,
document.querySelector('#d2'));
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js"></script>
.person{
border: 1px solid blue;
width:150px;
padding:10px;
display:inline-block;
margin:10px;
box-shadow:5px 5px #ccc;
color:red;
}
div{
display:inline-block
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment