A Pen by MD.Tanvir Rahman on CodePen.
Created
September 16, 2020 11:06
-
-
Save tanviredu/44c4604c407c402cb70a5b130392ff4c to your computer and use it in GitHub Desktop.
A Basic React App For understanding the Basic
This file contains hidden or 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 id="app"> | |
</div> |
This file contains hidden or 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 Person(props){ | |
console.log(props) // this is an object | |
return ( | |
<div className="jumbotron" id="p1"> | |
<h1 className="display-4">{props.name}</h1> | |
<p>Age : {props.age} </p> | |
</div> | |
); | |
} | |
// this person is a component | |
// and it has two differnt conponent | |
// and it will be mounted in app id | |
let persons = ( | |
<div> | |
<Person name="Karim" age="27" /> | |
<Person name="Rahim" age="30" /> | |
</div> | |
) | |
ReactDOM.render(persons,document.querySelector('#app')); |
This file contains hidden or 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/16.13.1/umd/react.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.13.1/umd/react-dom.production.min.js"></script> |
This file contains hidden or 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
#p1{ | |
border:3px solid; | |
width:250px; | |
padding:20px; | |
margin:10px; | |
} |
This file contains hidden or 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
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment