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
language: generic | |
sudo: required | |
services: | |
- docker | |
before_install: | |
- docker build -t indreklasn/my-react-docker-app -f Dockerfile.dev . | |
script: |
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
FROM node:alpine | |
WORKDIR /app | |
COPY package.json /app | |
RUN yarn install && yarn cache clean | |
COPY . /app |
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
FROM node:alpine | |
WORKDIR /app | |
COPY package.json /app | |
RUN yarn install | |
COPY . /app |
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
FROM node:alpine | |
WORKDIR /app | |
COPY package.json /app | |
RUN yarn install | |
COPY . /app |
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
touch Dockerfile Dockerfile.dev docker-compose.yml |
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
npx create-react-app my-react-docker-app |
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
import React from 'react'; | |
import Cards from 'react-credit-cards'; | |
export default class PaymentForm extends React.Component { | |
state = { | |
cvc: '', | |
expiry: '', | |
focus: '', | |
name: '', | |
number: '', | |
}; |
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
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(){ |
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
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> |