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
import React, { Component } from "react"; | |
export class App extends Component { | |
render() { | |
const todos = [ | |
{ id: 1, text: "do something" }, | |
{ id: 2, text: "do something else" }, | |
{ id: 3, text: "do nothing" } | |
]; | |
const todoItems = todos.map(todo => <li key={todo.id}>{todo.text}</li>); |
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
import React, { Component } from "react"; | |
export class App extends Component { | |
render() { | |
const numbers = [1, 2, 3, 4, 5]; | |
return ( | |
<div> | |
<NumbersList numbers={numbers} /> | |
</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
import React, { Component } from "react"; | |
export class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
warn: true | |
}; | |
this.handleToggle = this.handleToggle.bind(this); | |
} |
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
import React, { Component } from "react"; | |
export class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isLoggedin: true | |
}; | |
this.loginHandler = this.loginHandler.bind(this); | |
this.logoutHandler = this.logoutHandler.bind(this); |
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
import React from "react"; | |
const messages = ["react", "angular", "javascript"]; | |
function App() { | |
return <MailBox unreadMessages={messages} />; | |
} | |
function MailBox(props) { | |
const unreadMessages = props.unreadMessages; |
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
import React, { Component } from "react"; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isLoggedin: false | |
}; | |
this.handleLogin = this.handleLogin.bind(this); | |
this.handleLogout = this.handleLogout.bind(this); |
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
import React, { Component } from "react"; | |
import "./App.css"; | |
import Calculator from "./Calculator"; | |
export class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<Calculator /> | |
</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
import React, { Component } from "react"; | |
import Counter from "./Counter"; | |
import ClickCounter from "./ClickCounter"; | |
import HoverCounter from "./HoverCounter"; | |
class App extends Component { | |
render() { | |
return ( | |
<div> | |
<Counter |
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
import React, { Component } from "react"; | |
import ClickCounter from "./ClickCounter"; | |
import HoverCounter from "./HoverCounter"; | |
class App extends Component { | |
render() { | |
return ( | |
<div> | |
<ClickCounter /> |
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 App() { | |
return ( | |
<div className="App"> | |
<Parent /> | |
</div> | |
); | |
} |
NewerOlder