|
1 | 1 | ---
|
2 | 2 | id: create-a-new-react-app
|
3 |
| -title: Create a New React App |
| 3 | +title: Створюємо новий React-додаток |
4 | 4 | permalink: docs/create-a-new-react-app.html
|
5 | 5 | redirect_from:
|
6 | 6 | - "docs/add-react-to-a-new-app.html"
|
7 | 7 | prev: add-react-to-a-website.html
|
8 | 8 | next: cdn-links.html
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -Use an integrated toolchain for the best user and developer experience. |
| 11 | +Для більш комфортної роботи використовуйте вбудований набір інструментів. |
12 | 12 |
|
13 |
| -This page describes a few popular React toolchains which help with tasks like: |
| 13 | +Ця сторінка описує декілька популярних наборів інструментів для роботи з React, що допоможуть вам з такими задачами як: |
14 | 14 |
|
15 |
| -* Scaling to many files and components. |
16 |
| -* Using third-party libraries from npm. |
17 |
| -* Detecting common mistakes early. |
18 |
| -* Live-editing CSS and JS in development. |
19 |
| -* Optimizing the output for production. |
| 15 | +* Масштабування великої кількості компонентів та файлів. |
| 16 | +* Використання сторонніх бібліотек з npm. |
| 17 | +* Раннє виявлення розповсюджених помилок. |
| 18 | +* Миттєве відстеження змін у CSS та JS файлах. |
| 19 | +* Оптимізація коду для продакшну. |
20 | 20 |
|
21 |
| -The toolchains recommended on this page **don't require configuration to get started**. |
| 21 | +Набори інструментів описані на цій сторінці **не потребують додаткового налаштування для початку роботи з ними**. |
22 | 22 |
|
23 |
| -## You Might Not Need a Toolchain {#you-might-not-need-a-toolchain} |
| 23 | +## Чи додаткові інструменти необхідні для вас? {#you-might-not-need-a-toolchain} |
24 | 24 |
|
25 |
| -If you don't experience the problems described above or don't feel comfortable using JavaScript tools yet, consider [adding React as a plain `<script>` tag on an HTML page](/docs/add-react-to-a-website.html), optionally [with JSX](/docs/add-react-to-a-website.html#optional-try-react-with-jsx). |
| 25 | +Якщо у вас не виникає проблем з вище описаними ситуаціями, або ж якщо ви ще не відчуваєте себе достатньо впевнено для використання інструменів для роботи з JavaScript, розгляньте можливість [додання React за допомогою тегу `<script>` на HTML-сторінку](/docs/add-react-to-a-website.html), при необхідності [за допомогою JSX](/docs/add-react-to-a-website.html#optional-try-react-with-jsx). |
26 | 26 |
|
27 |
| -This is also **the easiest way to integrate React into an existing website.** You can always add a larger toolchain if you find it helpful! |
| 27 | +Також це **найпростіший спосіб додати бібліотеку React до існуючого сайту.** Ви завжди можете розширити набір інструментів, за потребою! |
28 | 28 |
|
29 |
| -## Recommended Toolchains {#recommended-toolchains} |
| 29 | +## Рекомендований набір інструментів {#recommended-toolchains} |
30 | 30 |
|
31 |
| -The React team primarily recommends these solutions: |
| 31 | +В першу чергу команда React рекомендує наступні рішення: |
32 | 32 |
|
33 |
| -- If you're **learning React** or **creating a new [single-page](/docs/glossary.html#single-page-application) app,** use [Create React App](#create-react-app). |
34 |
| -- If you're building a **server-rendered website with Node.js,** try [Next.js](#nextjs). |
35 |
| -- If you're building a **static content-oriented website,** try [Gatsby](#gatsby). |
36 |
| -- If you're building a **component library** or **integrating with an existing codebase**, try [More Flexible Toolchains](#more-flexible-toolchains). |
| 33 | +- Якщо ви **вивчаєте React** або **створюєте новий [односторінковий](/docs/glossary.html#single-page-application) додаток,** використовуйте [Create React App](#create-react-app). |
| 34 | +- Якщо ви створюєте **серверний сайт з допомогою Node.js,** спробуйте [Next.js](#nextjs). |
| 35 | +- Якщо ви створюєте **статичний контент-орієнтований вебсайт,** спробуйте [Gatsby](#gatsby). |
| 36 | +- Якщо ви створюєте **бібліотеку компонентів** або **інтегруєте існуючий код**, спробуйте [більш гнучкий набір інструментів](#more-flexible-toolchains). |
37 | 37 |
|
38 | 38 | ### Create React App {#create-react-app}
|
39 | 39 |
|
40 |
| -[Create React App](https://github.com/facebookincubator/create-react-app) is a comfortable environment for **learning React**, and is the best way to start building **a new [single-page](/docs/glossary.html#single-page-application) application** in React. |
| 40 | +[Create React App](https://github.com/facebookincubator/create-react-app) -- це комфортний осередок для **вивчення React**, а також це найкращий шлях щоб почати будувати **нові [односторінкові](/docs/glossary.html#single-page-application) додатки** за допомогою React. |
41 | 41 |
|
42 |
| -It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production. You’ll need to have Node >= 6 and npm >= 5.2 on your machine. To create a project, run: |
| 42 | +Він встановлює осередок для разробки таким чином, щоб ви могли використовувати найновіші можливості JavaScript, робить розробку комфортнішою, а також оптимізує ваш додаток для продакшну. Вам знадобиться Node версії >= 6 та npm версії >= 5.2 на вашому комп'ютері. Для створення проекту виконайте: |
43 | 43 |
|
44 | 44 | ```bash
|
45 | 45 | npx create-react-app my-app
|
46 | 46 | cd my-app
|
47 | 47 | npm start
|
48 | 48 | ```
|
49 | 49 |
|
50 |
| ->Note |
| 50 | +>Примітка |
51 | 51 | >
|
52 |
| ->`npx` on the first line is not a typo -- it's a [package runner tool that comes with npm 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). |
| 52 | +>`npx` на першому рядку це не одрук. Це [інструмент для запуску пакетів, з'явившийся в npm версії 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). |
53 | 53 |
|
54 |
| -Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. Under the hood, it uses [Babel](https://babeljs.io/) and [webpack](https://webpack.js.org/), but you don't need to know anything about them. |
| 54 | +Create React App не опрацьовує бекенд логіку чи логіку баз данних, а лише надає команди для побудови фронтенду, тому ви можете використовувати його з будь-яким бекендом. Під капотом він використовує [Babel](https://babeljs.io/) та [webpack](https://webpack.js.org/), але вам не треба нічого знати про них. |
55 | 55 |
|
56 |
| -When you're ready to deploy to production, running `npm run build` will create an optimized build of your app in the `build` folder. You can learn more about Create React App [from its README](https://github.com/facebookincubator/create-react-app#create-react-app-) and the [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents). |
| 56 | +Коли ваш додаток буде готовий для розгортання на продакшн, запустіть команду `npm run build`, це створить оптимізовану версію вашого додатку у папці `build`. Ви можете дізнатись більше про Create React App [з його README](https://github.com/facebookincubator/create-react-app#create-react-app-) та [його керівництва користувача](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents). |
57 | 57 |
|
58 | 58 | ### Next.js {#nextjs}
|
59 | 59 |
|
60 |
| -[Next.js](https://nextjs.org/) is a popular and lightweight framework for **static and server‑rendered applications** built with React. It includes **styling and routing solutions** out of the box, and assumes that you're using [Node.js](https://nodejs.org/) as the server environment. |
| 60 | +[Next.js](https://nextjs.org/) це популярний й легкий фреймворк для **статичних та серверних додатків**, створений з допомогою React. Він включає **готові рішення для стилізації та маршрутизації** й передбачає, що ви використовуєте [Node.js](https://nodejs.org/) як серверний осередок. |
61 | 61 |
|
62 |
| -Learn Next.js from [its official guide](https://nextjs.org/learn/). |
| 62 | +Дізнайтесь більше про Next.js з [його офіційного керівництва](https://nextjs.org/learn/). |
63 | 63 |
|
64 | 64 | ### Gatsby {#gatsby}
|
65 | 65 |
|
66 |
| -[Gatsby](https://www.gatsbyjs.org/) is the best way to create **static websites** with React. It lets you use React components, but outputs pre-rendered HTML and CSS to guarantee the fastest load time. |
| 66 | +[Gatsby](https://www.gatsbyjs.org/) це найкращий спосіб створити **статичний вебсайт** з React. Він дозволяє використовувати React-компоненти, але виводить попередньо відрендеренний HTML та CSS, щоб гарантувати найшвидший час завантаження. |
67 | 67 |
|
68 |
| -Learn Gatsby from [its official guide](https://www.gatsbyjs.org/docs/) and a [gallery of starter kits](https://www.gatsbyjs.org/docs/gatsby-starters/). |
| 68 | +Дізнайтесь більше про Gatsby з [його офіційного керівництва](https://www.gatsbyjs.org/docs/) та [галереї стартових наборів](https://www.gatsbyjs.org/docs/gatsby-starters/). |
69 | 69 |
|
70 |
| -### More Flexible Toolchains {#more-flexible-toolchains} |
| 70 | +### Більш гнучкі набори інструментів {#more-flexible-toolchains} |
71 | 71 |
|
72 |
| -The following toolchains offer more flexiblity and choice. We recommend them to more experienced users: |
| 72 | +Наступні набори пропонують більше гнучкості та вибору. Ми рекомендуємо їх для більш досвідчених розробників: |
73 | 73 |
|
74 |
| -- **[Neutrino](https://neutrinojs.org/)** combines the power of [webpack](https://webpack.js.org/) with the simplicity of presets, and includes a preset for [React apps](https://neutrinojs.org/packages/react/) and [React components](https://neutrinojs.org/packages/react-components/). |
| 74 | +- **[Neutrino](https://neutrinojs.org/)** поєднує у собі [webpack](https://webpack.js.org/) з простотою його пресетів та включає в себе пресети для [React-додатків](https://neutrinojs.org/packages/react/) й [React-компонентів](https://neutrinojs.org/packages/react-components/). |
75 | 75 |
|
76 |
| -- **[nwb](https://github.com/insin/nwb)** is particularly great for [publishing React components for npm](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb). It [can be used](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb) for creating React apps, too. |
| 76 | +- **[nwb](https://github.com/insin/nwb)** чудово використовувати для [публікації React-компонентів у npm](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb). Він [також може використовуватись для](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb) для створення React-додатків. |
77 | 77 |
|
78 |
| -- **[Parcel](https://parceljs.org/)** is a fast, zero configuration web application bundler that [works with React](https://parceljs.org/recipes.html#react). |
| 78 | +- **[Parcel](https://parceljs.org/)** -- швидкий бандлер веб-додатків з нульовою конфігурацією, [який працює з React](https://parceljs.org/recipes.html#react). |
79 | 79 |
|
80 |
| -- **[Razzle](https://github.com/jaredpalmer/razzle)** is a server-rendering framework that doesn't require any configuration, but offers more flexibility than Next.js. |
| 80 | +- **[Razzle](https://github.com/jaredpalmer/razzle)** -- це фреймворк для серверного рендерингу, що не потребує ніякої конфігурації, але більш гнучкий ніж Next.js. |
81 | 81 |
|
82 |
| -## Creating a Toolchain from Scratch {#creating-a-toolchain-from-scratch} |
| 82 | +## Створення набору інструментів з нуля {#creating-a-toolchain-from-scratch} |
83 | 83 |
|
84 |
| -A JavaScript build toolchain typically consists of: |
| 84 | +Набір інструментів JavaScript зазвичай включає: |
85 | 85 |
|
86 |
| -* A **package manager**, such as [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/). It lets you take advantage of a vast ecosystem of third-party packages, and easily install or update them. |
| 86 | +* **Менеджер пакетів**, такий як [Yarn](https://yarnpkg.com/) або [npm](https://www.npmjs.com/). Він дозволяє отримати переваги великої екосистеми сторонніх пакетів, а також легкість їх встановлення чи оновлення. |
87 | 87 |
|
88 |
| -* A **bundler**, such as [webpack](https://webpack.js.org/) or [Parcel](https://parceljs.org/). It lets you write modular code and bundle it together into small packages to optimize load time. |
| 88 | +* **Бандлер**, такий як [webpack](https://webpack.js.org/) або [Parcel](https://parceljs.org/). Він надає можливість писати модульний код та збирати його у невеликі пакети з метою оптимізації часу завантаження. |
89 | 89 |
|
90 |
| -* A **compiler** such as [Babel](https://babeljs.io/). It lets you write modern JavaScript code that still works in older browsers. |
| 90 | +* **Компілятор**, такий як [Babel](https://babeljs.io/). Він дозволяє писати сучасний JavaScript код, що буде працювати у старіших браузерах. |
91 | 91 |
|
92 |
| -If you prefer to set up your own JavaScript toolchain from scratch, [check out this guide](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658) that re-creates some of the Create React App functionality. |
| 92 | +Якщо ви віддаєте перевагу написанню власного набору JavaScript-інструментів з нуля, [ознайомтесь з цим керівництвом](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658), в якому відтворюється деяка функціональність Create React App. |
93 | 93 |
|
94 |
| -Don't forget to ensure your custom toolchain [is correctly set up for production](/docs/optimizing-performance.html#use-the-production-build). |
| 94 | +Не забудьте переконатись, що ваш власний набір інструментів [правильно налаштований для продакшну](/docs/optimizing-performance.html#use-the-production-build). |
0 commit comments