A Pen by WeirdKshitiz on CodePen.
Created
April 8, 2021 04:23
-
-
Save WeirdKshitiz/ec009560d5bd86d7bd51a6ba335a84c4 to your computer and use it in GitHub Desktop.
8thApril 2nd project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div id="d1"></div> | |
<div id="d2"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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