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
function ValidationMessage(props) { | |
if (!props.valid) { | |
return <div className='error-msg'>{props.message}</div> | |
} | |
return null; | |
} |
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
//Step One - set state | |
state = { | |
username: '', usernameValid: false, | |
formValid: false, | |
errorMsg: {} | |
} | |
// Step Two Part A - Add onChange to form field (inside your render fn) | |
<div className='form-group'> | |
<label htmlFor='username'>Username</label> |
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
node_modules | |
^(assert|buffer|crypto|events|fs|net|util|url|path|timers|_http_server|_http_common|_http_incoming|_http_outgoing|_stream_writable|_stream_readable|_stream_duplex)\.js |
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
UserContext.js | |
-define the user context | |
const UserContext = React.createContext({ | |
name: 'Joe', | |
setName: () => {} | |
}); | |
-- |
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 fs = require("fs"); | |
const nodeFS = require("node-fs"); | |
const argv = require('yargs') | |
.usage('Usage: npm run generate [component] [relative/to/src]') | |
.describe('relative/to/src', 'allows nested directory creation from ./src folder') | |
.example('npm run generate FooList') | |
.example('npm run generate FooList Components/Foo') | |
.demandOption(['component']) | |
.help() | |
.argv; |
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
increment = async () => { | |
await this.setState({value: this.state.value + 1}) | |
this.setState({ | |
values: [...this.state.values, this.state.value] | |
}) | |
} |
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
Show hidden characters
{ | |
/** | |
* ESLint: http://eslint.org/docs/user-guide/configuring | |
*/ | |
"globals": { | |
"$": true | |
}, | |
// "env:" supplies predefined global variables |
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
Youtube Subscription List Endpoint | |
Required: part - string: | |
Value Options: contentDetails, id, snippet, subscriberSnippet | |
Optional 1: | |
forChannelId: String | |
Description: The forChannelId parameter specifies a comma-separated list of channel IDs. | |
The API response will then only contain subscriptions matching those channels. | |
Optional 2: |
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
function addNewItem(store, name) { | |
// create a new item object | |
// add it to the store array | |
} | |
function toggleCompleted(store, name) { | |
// find item by name in the store array | |
// update the completed property to be the opposite of what it is currently | |
} |