Giter Site home page Giter Site logo

router's Introduction

Клиентский роутер + Material design

  1. Создание папки с текуцщей датой и временем и клонирование основного проекта (ветка Heroku) cd && mkdir $(date +%Y%m%d_%H%M%S) && cd $_ && git clone -b heroku https://github.com/GossJS/reactDemo2018.git . && yarn
  2. Установили зависимость yarn add react-router-dom
  3. Вынесли звёзды и счётчик в отдельный файл Counter.jsx
  4. По аналогии создали файлы Map.jsx, Gallery.jsx, datapickerz.jsx
  5. Включили опцию Чтобы в режиме WDS можно было вводить маршруты прямо в адресной строке типа http://localhost:1234/gallery :

devServer: { port: WDS_PORT, host: '0.0.0.0', historyApiFallback: true, }

6.Прописываем импорты в index.jsx: import React from 'react'; import { render as r } from 'react-dom'; import { BrowserRouter, Switch, Route, Link } from 'reactrouter-dom'; import Counter from './Counter'; import Map from './Map'; import Gallery from './Gallery';

  1. В командной строке ввели: npm run build, ввели в браузере 127.0.0.1:1234 и получили: alt text alt text alt text alt text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.