Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
React.js - create first app


Commands and code used to create my first React app during training.


  1. Create React App - source coude and tool usefull for creating app in React.js
  2. Artur Chyży repository
  3. Pragmatists TDD Todos React app

Create React App

npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start


Setup tests

npm install --save-dev enzyme enzyme-adapter-react-16 react-test-renderer jest-cli jest-enzyme

Install type definitions for npm

npm i @types/jest @types/enzyme @types/expect

JSON server for tests

Fake Online REST API for Testing and Prototyping: JSONPlaceholder

npm install -g json-server
json-server --port 3001

HTTP client

npm install --save axios

Przykład pobrania danych:

            .then(response =>
            .then(data => {
                    todos: data

Przykład dodania danych do serwera:'http://localhost:3001/todos', todo)
            .then(() => this.fetchData());


npm install --save react-router react-router-dom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.