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
| <head> | |
| </head> | |
| <body> | |
| <div id="app"/> | |
| </body> |
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
| <head> | |
| <link rel="stylesheet" href="https://bootswatch.com/4/sketchy/bootstrap.css"> | |
| </head> | |
| <body> | |
| <div id="app"/> | |
| </body> | |
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
| <head> | |
| <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script> | |
| <title>Random Quote Generator</title> | |
| </head> | |
| <body> | |
| <div id="heading"> | |
| <h1 id="heading-text">Random Quote Generator</h1> | |
| </div> | |
| <div id="app"></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
| const INCREMENT = "INCREMENT"; // define a constant for increment action types | |
| const DECREMENT = "DECREMENT"; // define a constant for decrement action types | |
| const counterReducer = (state = 0, action) => { | |
| switch (action.type){ | |
| case INCREMENT: | |
| return state + 1 | |
| case DECREMENT: | |
| return state - 1 |
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
| class Counter extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| {/*Declares state property; component is initialized with this state*/} | |
| this.state = { | |
| count: 0 | |
| }; | |
| // change code below this line | |
| {/*Binds this to new methods*/} | |
| this.increment = this.increment.bind(this); |
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
| {/*Defines the class as an extension of React.Component*/} | |
| class MyComponent extends React.Component{ | |
| constructor(prop){ | |
| super(prop); | |
| } | |
| render(){ | |
| return( | |
| <div> | |
| <h1>My First React Component!</h1> | |
| </div> |
NewerOlder