Created
July 30, 2017 21:27
-
-
Save anonymous/5e6607bc7eca7cedc86e0ba1a6c88ced to your computer and use it in GitHub Desktop.
firstReact
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="mountode"> </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
| var node=document.getElementById("mountode"); | |
| function Blog(props){ | |
| return ( | |
| <div> | |
| <h2>{props.baslik}</h2> | |
| <p>{props.metin}</p> | |
| </div> | |
| ); | |
| } | |
| function Postcomment(props){ | |
| return( | |
| <div> | |
| <h4>{props.name}</h4> | |
| <span>{props.tex}</span> | |
| </div> | |
| ) | |
| } | |
| function Comment(){ | |
| return( | |
| <div> | |
| <Postcomment name="First" tex="This is first comment"/> | |
| <Postcomment name="Second" tex="Other Comment"/> | |
| <Postcomment name="Other" tex="İt is it"/> | |
| <input type="text" placeholder="Write your comment"/> | |
| </div> | |
| ); | |
| } | |
| function Complete(prop){ | |
| return( | |
| <div> | |
| <Blog baslik={prop.bas} metin={prop.metin}/> | |
| <Comment/> | |
| </div> | |
| ); | |
| } | |
| function App(){ | |
| return( | |
| <div> | |
| <Complete bas="baslik" metin="Bu bir metindir"/> | |
| <Complete bas="Olay" metin="Sen ne diyorsun"/> | |
| <Complete bas="Söylüyorlar" metin="Sen öykülerini anlat"/> | |
| <Complete bas="Beyinli Adam" metin="Yazık be kardeşim"/> | |
| </div> | |
| ); | |
| } | |
| ReactDOM.render(<App />,node); |
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/15.6.1/react.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My first React Example Blog example can't use map and other thing but i thing this is useful enough.