Skip to content

Instantly share code, notes, and snippets.

View indreklasn's full-sized avatar
👋

Trevor I. Lasn indreklasn

👋
View GitHub Profile
language: generic
sudo: required
services:
- docker
before_install:
- docker build -t indreklasn/my-react-docker-app -f Dockerfile.dev .
script:
FROM node:alpine
WORKDIR /app
COPY package.json /app
RUN yarn install && yarn cache clean
COPY . /app
FROM node:alpine
WORKDIR /app
COPY package.json /app
RUN yarn install
COPY . /app
FROM node:alpine
WORKDIR /app
COPY package.json /app
RUN yarn install
COPY . /app
touch Dockerfile Dockerfile.dev docker-compose.yml
npx create-react-app my-react-docker-app
import React from 'react';
import Cards from 'react-credit-cards';
export default class PaymentForm extends React.Component {
state = {
cvc: '',
expiry: '',
focus: '',
name: '',
number: '',
};
import React, { Component } from 'react';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
// minified version is also included
// import 'react-toastify/dist/ReactToastify.min.css';
class App extends Component {
notify = () => toast("Wow so easy notifications!");
render(){
import React from "react";
import Sidebar from "react-sidebar";
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
sidebarOpen: true
};
this.onSetSidebarOpen = this.onSetSidebarOpen.bind(this);
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import 'react-tabs/style/react-tabs.css';
export default () => (
<Tabs>
<TabList>
<Tab>Title 1</Tab>
<Tab>Title 2</Tab>
</TabList>