Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2017 21:27
Show Gist options
  • Select an option

  • Save anonymous/5e6607bc7eca7cedc86e0ba1a6c88ced to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/5e6607bc7eca7cedc86e0ba1a6c88ced to your computer and use it in GitHub Desktop.
firstReact
<div id="mountode"> </div>
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);
<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>
@anilkay
Copy link

anilkay commented Jul 30, 2017

My first React Example Blog example can't use map and other thing but i thing this is useful enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment