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
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/sia1/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Uncomment the following line to use case-sensitive completion. |
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
<div id="root"></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
<div id="container" class="container"></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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<header>Header</header> |
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, PropTypes} from 'react' | |
import View from './View' | |
import Button from '../common/Button' | |
export default class Document extends Component { | |
static propTypes = { | |
program: PropTypes.object.isRequired, | |
} | |
constructor() { |
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 serialize from 'form-serialize' | |
export class FrontEndPartyControlled extends Component { | |
static defaultProps = { | |
name: '', | |
spiritAnimal: '', | |
} | |
constructor(props) { |
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
// BrowserRouter is the router implementation for HTML5 browsers (vs Native). | |
// Link is your replacement for anchor tags. | |
// Route is the conditionally shown component based on matching a path to a URL. | |
// Switch returns only the first matching route rather than all matching routes. | |
import { | |
BrowserRouter as Router, | |
Link, | |
Route, | |
Switch, | |
} from 'react-router-dom'; |
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 default class BasicControlledForm extends Component { | |
constructor() { | |
super() | |
// Initialize the values for our input properties with empty strings | |
this.state = { | |
firstName: '', | |
spiritAnimal: '', | |
} |
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 the serialize function from the form-serialize package | |
import serialize from 'form-serialize' | |
export default class UncontrolledSerialized extends Component { | |
onSubmit = (e) => { | |
e.preventDefault() | |
// Usually, we would pass the final input values to a function that | |
// would do something with the data like persist it to a database. | |
// Using serialization, we just need to pass that function the |
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 default class UncontrolledRefsForm extends Component { | |
onSubmit = (e) => { | |
e.preventDefault() | |
// Usually, we would pass the final input values to a function that | |
// would do something with the data like persist it to a database. | |
// Using refs, we just need to pass the reference values. | |
console.log({ | |
firstName: this.firstName.value, |