Created
April 9, 2022 20:10
-
-
Save natafaye/99d406b8c207fef42bd0462ba96498f9 to your computer and use it in GitHub Desktop.
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
| import { Component } from "react"; | |
| import Order from "./ChildComponent"; | |
| import { TEST_STUDENTS } from "./shared/student-test-data"; | |
| // function App(props) { | |
| // return ( | |
| // <div className="App"> | |
| // <p className="my-class"></p> | |
| // </div> | |
| // ); | |
| // } | |
| class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| dish: "", | |
| addCheese: false | |
| } | |
| } | |
| pickDish = (newDish) => { | |
| this.setState({ dish: newDish }) | |
| } | |
| render() { | |
| return ( | |
| <div className="App"> | |
| Dish: | |
| <button onClick={ () => this.setState({ dish: "burrito" }) }>Burrito</button> | |
| <button onClick={ () => this.pickDish("taco") }>Taco</button> | |
| <p> | |
| <Order dish={this.state.dish} /> | |
| </p> | |
| </div> | |
| ); | |
| } | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment