Skip to content

Instantly share code, notes, and snippets.

View wwwhatley's full-sized avatar
🎯
Focusing

William Whatley wwwhatley

🎯
Focusing
View GitHub Profile
import styled from 'styled-components';
// Forms, inputs, buttons
export const Form = styled.form`
width: 300px;
display: flex;
flex-direction: column;
align-items: center;
`;
import React, {Component} from 'react';
import styled from 'styled-components';
const Title = styled.h1`
font-family: 'Raleway', sans-serif;
font-weight: 600;
color: #4d4d4d;
font-size: 2.2em;
`;
import styled from 'styled-components';
const Title = styled.h1`
font-family: 'Raleway', sans-serif;
font-weight: 600;
color: #4d4d4d;
font-size: 2.2em;
`;
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0,
};
}
increment = () => {
this.setState(prevState => {
import {withRouter} from 'react-router-dom';
class App extends React.Component {
constructor() {
super();
this.state = {path: ''}
}
componentDidMount() {
let pathName = this.props.location.pathname;
const GreetingCard = (props) => {
return (
<div>
<h1>{props.name}</h1>
</div>
)
}
class Greeting extends React.Component {
constructor() {
@wwwhatley
wwwhatley / GreetingCard.jsx
Last active July 10, 2018 12:25
Functional stateless component
const GreetingCard = (props) => {
return (
<div>
<h1>Hello! {props.name}</h1>
</div>
)
}
class Greeting extends React.Component {
constructor() {
super();
this.state = {
name: "",
};
}
componentDidMount() {
// AJAX