Permalink
Browse files

Ornekleri ekle

  • Loading branch information...
ustun committed Feb 11, 2015
1 parent 69b0030 commit 50a7ded2f895babf51fd4dbfc6f2d8e198b78a55
View
@@ -0,0 +1 @@
.module-cache
View
@@ -171,8 +171,8 @@ var Selamlama = React.createClass({
render: function () {
return (
<div>
<MerhabaDünya/>
<MerhabaDünya/>
<MerhabaDunya/>
<MerhabaDunya/>
</div>)
}
})
@@ -207,8 +207,8 @@ dönüşmekte. Yani `<div>Merhaba {this.props.isim}</div>` yerine `div(null,
var Selamlama = React.createClass({
render: function () {
return <div>
<MerhabaDünya isim="Üstün"/>
<MerhabaDünya isim="Özgür"/>
<MerhabaDunya isim="Üstün"/>
<MerhabaDunya isim="Özgür"/>
</div>
}
})
@@ -275,7 +275,7 @@ var Sayac = React.createClass({
artir: function () {
// Buraya ne yazmalıyız?
}
},
render: function () {
return (
@@ -301,8 +301,8 @@ var Sayac = React.createClass({
artir: function () {
var suAnkiSayac = this.state.sayac;
this.setState(state: suAnkiŞayac + 1);
}
this.setState({sayac: suAnkiSayac + 1});
},
render: function () {
return (
@@ -351,15 +351,15 @@ var Sayac = React.createClass({
artir: function () {
var suAnkiSayac = this.state.sayac;
this.setState(state: suAnkiSayac + 1);
}
this.setState({sayac: suAnkiSayac + 1});
},
render: function () {
return (
<div>
Sayaca {this.state.sayac} kez tıkladınız.
{10 - this.state.sayac} kez daha tıklamalısınız.
<button önClıck={this.artir}>Sayaç</button>
<button onClick={this.artir}>Sayaç</button>
</div>
);
}
View
@@ -0,0 +1,9 @@
build:
jsx --watch src build
ornekler:
open -a 'Google Chrome' index.html
.PHONY: build
@@ -0,0 +1,7 @@
var MerhabaDunya = React.createClass({displayName: "MerhabaDunya",
render: function () {
return React.createElement("div", null, "Merhaba Dunya");
}
})
React.render(React.createElement(MerhabaDunya, null), document.body);
@@ -0,0 +1,20 @@
var Sayac = React.createClass({displayName: "Sayac",
getInitialState: function () {
return {sayac: 0};
},
artir: function () {
var suAnkiSayac = this.state.sayac;
this.setState({sayac: suAnkiSayac + 1});
},
render: function () {
return (
React.createElement("div", null,
"Sayaca ", this.state.sayac, " kez tıkladınız",
React.createElement("button", {onClick: this.artir}, "Sayaç")
))
}
})
React.render(React.createElement(Sayac, null), document.body);
@@ -0,0 +1,17 @@
var MerhabaDunya = React.createClass({displayName: "MerhabaDunya",
render: function () {
return React.createElement("div", null, "Merhaba Dunya");
}
});
var Selamlama = React.createClass({displayName: "Selamlama",
render: function () {
return (
React.createElement("div", null,
React.createElement(MerhabaDunya, null),
React.createElement(MerhabaDunya, null)
))
}
})
React.render(React.createElement(Selamlama, null), document.body)
@@ -0,0 +1,16 @@
var MerhabaDunya = React.createClass({displayName: "MerhabaDunya",
render: function () {
return React.createElement("div", null, "Merhaba ", this.props.isim)
}
});
var Selamlama = React.createClass({displayName: "Selamlama",
render: function () {
return React.createElement("div", null,
React.createElement(MerhabaDunya, {isim: "Üstün"}),
React.createElement(MerhabaDunya, {isim: "Özgür"})
)
}
})
React.render(React.createElement(Selamlama, null), document.body)
View
@@ -0,0 +1,22 @@
var Sayac = React.createClass({displayName: "Sayac",
getInitialState: function () {
return {sayac: 0};
},
artir: function () {
var suAnkiSayac = this.state.sayac;
this.setState({sayac: suAnkiSayac + 1});
},
render: function () {
return (
React.createElement("div", null,
"Sayaca ", this.state.sayac, " kez tıkladınız",
React.createElement("button", {onClick: this.artir}, "Sayaç")
))
}
})
React.render(React.createElement(Sayac, null), document.body);
@@ -0,0 +1,22 @@
var Sayac = React.createClass({displayName: "Sayac",
getInitialState: function () {
return {sayac: 0};
},
artir: function () {
var suAnkiSayac = this.state.sayac;
this.setState({sayac: suAnkiSayac + 1});
},
render: function () {
return (
React.createElement("div", null,
"Sayaca ", this.state.sayac, " kez tıkladınız.",
10 - this.state.sayac, " kez daha tıklamalısınız.",
React.createElement("button", {onClick: this.artir}, "Sayaç")
)
);
}
})
React.render(React.createElement(Sayac, null), document.body);
@@ -0,0 +1,39 @@
var Sayac = React.createClass({displayName: "Sayac",
render: function () {
return (
React.createElement("div", null,
"Sayaca ", this.props.sayac, " kez tıkladınız.",
10 - this.props.sayac, " kez daha tıklamalısınız.",
React.createElement("button", {onClick: this.props.artir}, "Sayaç")
));
}
});
var Sayaclar = React.createClass({displayName: "Sayaclar",
getInitialState: function () {
return {sayac1: 3, sayac2: 5};
},
sayac1Artir: function () {
this.setState({sayac1: this.state.sayac1 + 1,
sayac2: this.state.sayac2 - 1});
},
sayac2Artir: function () {
this.setState({sayac1: this.state.sayac1 - 1,
sayac2: this.state.sayac2 + 1});
},
render: function () {
return (
React.createElement("div", null,
React.createElement(Sayac, {sayac: this.state.sayac1, artir: this.sayac1Artir}),
React.createElement(Sayac, {sayac: this.state.sayac2, artir: this.sayac2Artir})
));
}
})
React.render(React.createElement(Sayaclar, null), document.body);
View
No changes.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,23 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="css/pure.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/app.css" type="text/css" media="screen" />
<script src="libs/react.js"></script>
</head>
<body>
<ol>
<li><a href="ornek1.html">Merhaba Dunya</a></li>
<li><a href="ornek2.html">Selamlama</a></li>
<li><a href="ornek3.html">Selamlama (props)</a></li>
<li><a href="ornek4.html">Sayac</a></li>
<li><a href="ornek5.html">Sayac (gerisayim)</a></li>
<li><a href="ornek6.html">Sayaclar</a></li>
</ol>
</body>
</html>
Oops, something went wrong.

0 comments on commit 50a7ded

Please sign in to comment.