Skip to content

Instantly share code, notes, and snippets.

import React from 'react'
import styled from 'styled-components'
export default props => (
<MyBeautifulButton>Click Me</MyBeautifulButton>
);
const MyBeautifulButton = styled.button`
margin: 16px;
border: solid palevioletred 2px;
@kjosavik
kjosavik / withoutStyledComponents.css
Created April 3, 2019 11:45
CSS file for WithoutStyledComponents.jsx
#main {
padding: 32px;
border: outset rgba(247, 159, 121, 1) 1px;
border-radius: 4px;
}
#output-area{
min-height: 128px;
margin: 16px;
cursor: default;
@kjosavik
kjosavik / WithoutStyledComponents.jsx
Created April 3, 2019 11:41
A simple app with an input field and submit button that displays the inputted text to a div. This one does not use styled-components
import React from 'react';
import '../assets/css/withoutStyledComponents.css'
export default class WithoutStyledComponents extends React.Component{
constructor(props){
const defaultOutput = "Change me...";
super(props);
this.state={
value: defaultOutput,
@kjosavik
kjosavik / WithStyledComponents.jsx
Created April 2, 2019 13:19
A simple app with an input field and submit button that displays the inputted text to a div.
import React from 'react';
import styled from 'styled-components';
export default class WithStyledComponents extends React.Component{
constructor(props){
const defaultOutput = "Change me...";
super(props);
this.state={
value: defaultOutput,