diff --git a/src/content/learn/importing-and-exporting-components.md b/src/content/learn/importing-and-exporting-components.md
index f8f55605..0204ef5b 100644
--- a/src/content/learn/importing-and-exporting-components.md
+++ b/src/content/learn/importing-and-exporting-components.md
@@ -1,26 +1,26 @@
---
-title: Importing and Exporting Components
+title: Importování a exportování komponent
---
-The magic of components lies in their reusability: you can create components that are composed of other components. But as you nest more and more components, it often makes sense to start splitting them into different files. This lets you keep your files easy to scan and reuse components in more places.
+Krása komponent spočívá v jejich znovupoužitelnosti, můžete vytvořit komponentu, která je složená z dalších komponent. Občas dává smysl, že jakmile začnete přidávat více a více komponent, je dobré je rozdělit do více souborů. Toto vede ke snazšímu čtení kódu a větší znovupoužitelnosti jednotlivých komponent.
-* What a root component file is
-* How to import and export a component
-* When to use default and named imports and exports
-* How to import and export multiple components from one file
-* How to split components into multiple files
+* Co je to kořenová komponenta
+* Jak importovat a exportovat komponenty
+* Kdy použít výchozí a kdy jmenný import a export
+* Jak importovat a exportovat vícero komponent z jednoho souboru
+* Jak rozdělit komponenty do dalších souborů
-## The root component file {/*the-root-component-file*/}
+## Kořenová komponenta {/*the-root-component-file*/}
-In [Your First Component](/learn/your-first-component), you made a `Profile` component and a `Gallery` component that renders it:
+V kapitole [Vaše první komponenta](/learn/your-first-component), byly vytvořeny komponenty `Profile` a `Gallery`, která ji rendruje:
@@ -52,17 +52,17 @@ img { margin: 0 10px 10px 0; height: 90px; }
-These currently live in a **root component file,** named `App.js` in this example. In [Create React App](https://create-react-app.dev/), your app lives in `src/App.js`. Depending on your setup, your root component could be in another file, though. If you use a framework with file-based routing, such as Next.js, your root component will be different for every page.
+V tomto příkladě jsou komponenty v ***kořenovém souboru*** jménem `App.js`. V [Create React App](https://create-react-app.dev/), je aplikace umístěna do `src/App.js`. V závislosti na projektu může být kořenová komponenta v úplně jiném souboru. Pokud používáte framework s navigací založenou na souborovém systému, jako je třeba Next.js, bude vaše kořenová komponenta jiná pro každou stránku.
-## Exporting and importing a component {/*exporting-and-importing-a-component*/}
+## Export a import komponent {/*exporting-and-importing-a-component*/}
-What if you want to change the landing screen in the future and put a list of science books there? Or place all the profiles somewhere else? It makes sense to move `Gallery` and `Profile` out of the root component file. This will make them more modular and reusable in other files. You can move a component in three steps:
+Představte si, že chcete na úvodní stránce zobrazit seznam učebnic. Nebo vložit seznam profilů někam jinam. Teď dává smysl přesunout `Gallery` a `Profile` mimo kořenový soubor. Tyto komponenty tak budou více modulární a znovupoužitelné i v dalších souborech. Komponenty můžete přesouvat pomocí těchto tří kroků:
-1. **Make** a new JS file to put the components in.
-2. **Export** your function component from that file (using either [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) or [named](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export#using_named_exports) exports).
-3. **Import** it in the file where you’ll use the component (using the corresponding technique for importing [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import#importing_defaults) or [named](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import#import_a_single_export_from_a_module) exports).
+1. **Vytvořte** nový JS soubor pro komponenty.
+2. **Exportujte** vaši funkcionální komponentu z tohoto souboru (použitím buď [výchozího](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export#using_the_default_export) nebo [jmenného](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export#using_named_exports) exportu).
+3. **Importujte** ji do souboru, kde se chystáte tuto komponentu použít (použitím korespondující techniky pro import [výchozí](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import#importing_defaults) nebo [jmenný](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import#import_a_single_export_from_a_module) import).
-Here both `Profile` and `Gallery` have been moved out of `App.js` into a new file called `Gallery.js`. Now you can change `App.js` to import `Gallery` from `Gallery.js`:
+Obě komponenty, `Profile` a `Gallery`, byly přesunuty mimo soubor `App.js` do nového souboru `Gallery.js`. Nyní můžete upravit `App.js` aby importoval `Gallery` z `Gallery.js`:
@@ -104,60 +104,60 @@ img { margin: 0 10px 10px 0; height: 90px; }
-Notice how this example is broken down into two component files now:
+Všimněte si, jak je tento příklad rozdělen do dvou souborů:
1. `Gallery.js`:
- - Defines the `Profile` component which is only used within the same file and is not exported.
- - Exports the `Gallery` component as a **default export.**
+ - Definuje `Profile` komponentu, která je použita pouze uvnitř tohoto souboru a není exportována.
+ - Exportuje `Gallery` komponentu jako **výchozí export.**
2. `App.js`:
- - Imports `Gallery` as a **default import** from `Gallery.js`.
- - Exports the root `App` component as a **default export.**
+ - Importuje `Gallery` přes **výchozí import** z `Gallery.js`.
+ - Exportuje kořenovou komponentu `App` jako **výchozí export.**
-You may encounter files that leave off the `.js` file extension like so:
+Můžete si povšimnout, že soubory postrádají příponu `.js` například tady:
-```js
+```js
import Gallery from './Gallery';
```
-Either `'./Gallery.js'` or `'./Gallery'` will work with React, though the former is closer to how [native ES Modules](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules) work.
+Obě `'./Gallery.js'` nebo `'./Gallery'` budou fungovat s Reactem, přestože první je blíže tomu, jak [nativní ES Moduly](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules) fungují.
-#### Default vs named exports {/*default-vs-named-exports*/}
+#### Výchozí vs. jmenné exporty {/*default-vs-named-exports*/}
-There are two primary ways to export values with JavaScript: default exports and named exports. So far, our examples have only used default exports. But you can use one or both of them in the same file. **A file can have no more than one _default_ export, but it can have as many _named_ exports as you like.**
+Máme dva hlavní způsoby jak exportovat hodnoty v JavaScriptu, výchozí a jmenný export. Prozatím jsme v našich příkladech používali pouze výchozí exporty. V jednom souboru můžeme použít jeden nebo oba způsoby. **Soubor může mít pouze jeden _výchozí_ export, ale může mít několik _jmenných_ exportů.**
-
+
-How you export your component dictates how you must import it. You will get an error if you try to import a default export the same way you would a named export! This chart can help you keep track:
+Druh exportu komponenty určuje jak ji musíte naimportovat. V případě, že se pokusíte importovat výchozí export jako jmenný, dostanete error! Tato tabulka vám pomůže s určením typu:
-| Syntax | Export statement | Import statement |
+| Syntaxe | Výraz pro export | Výraz pro import |
| ----------- | ----------- | ----------- |
-| Default | `export default function Button() {}` | `import Button from './Button.js';` |
-| Named | `export function Button() {}` | `import { Button } from './Button.js';` |
+| Výchozí | `export default function Button() {}` | `import Button from './Button.js';` |
+| Jmenný | `export function Button() {}` | `import { Button } from './Button.js';` |
-When you write a _default_ import, you can put any name you want after `import`. For example, you could write `import Banana from './Button.js'` instead and it would still provide you with the same default export. In contrast, with named imports, the name has to match on both sides. That's why they are called _named_ imports!
+S _výchozím_ importem můžete za klíčové slovo `import` vložit jakékoliv jméno. Například můžete napsat `import Banana from './Button.js'` a stále dostane výchozí export. Na rozdíl od jmenných importů, kde musí jméno odpovídat na obou stranách. Proto se jim říká _jmenné_ importy!
-**People often use default exports if the file exports only one component, and use named exports if it exports multiple components and values.** Regardless of which coding style you prefer, always give meaningful names to your component functions and the files that contain them. Components without names, like `export default () => {}`, are discouraged because they make debugging harder.
+**Výchozí export se většinou používá pokud soubor exportuje pouze jednu komponentu. Naopak jmenný export se používá tam, kde se exportuje více komponent nebo hodnot z jednoho souboru.** Nehledě jaký programátorský styl preferujete, dávejte komponentám a souborům které je obsahují smysluplné názvy. Bezejmenná komponenta, například `export default () => {}`, je nežádoucí protože je těžké ji debugovat.
-## Exporting and importing multiple components from the same file {/*exporting-and-importing-multiple-components-from-the-same-file*/}
+## Exportování a importování vícero komponent ze stejného souboru {/*exporting-and-importing-multiple-components-from-the-same-file*/}
-What if you want to show just one `Profile` instead of a gallery? You can export the `Profile` component, too. But `Gallery.js` already has a *default* export, and you can't have _two_ default exports. You could create a new file with a default export, or you could add a *named* export for `Profile`. **A file can only have one default export, but it can have numerous named exports!**
+Co když chceme zobrazit pouze `Profile` namísto galerie? Komponentu `Profile` lze také vyexportovat. Pozor, soubor `Gallery.js` již má *výchozí* export a nemůže mít _dva_ výchozí exporty. Můžete vytvořit nový soubor s výchozím exportem, nebo můžete přidat jmenný export pro komponentu `Profile`. **Soubor může mít pouze jeden výchozí export, ale může mít vícero jmenných exportů!**
-To reduce the potential confusion between default and named exports, some teams choose to only stick to one style (default or named), or avoid mixing them in a single file. Do what works best for you!
+Pro zjednodušení, se některé týmy rozhodly používat pouze jeden styl (výchozí nebo jmenný) nebo nemíchat tyto styly v jednom souboru. Zařiďte se podle sebe!
-First, **export** `Profile` from `Gallery.js` using a named export (no `default` keyword):
+Nejprve **exportujte** `Profile` z `Gallery.js` použitím jmenného exportu (bez klíčového slova `default`):
```js
export function Profile() {
@@ -165,13 +165,13 @@ export function Profile() {
}
```
-Then, **import** `Profile` from `Gallery.js` to `App.js` using a named import (with the curly braces):
+Poté **importujte** `Profile` z `Gallery.js` do `App.js` použitím jmenného importu (se složenými závorkami):
```js
import { Profile } from './Gallery.js';
```
-Finally, **render** `` from the `App` component:
+Nakonec **vyrenderujte** `` v komponentě `App`:
```js
export default function App() {
@@ -179,7 +179,7 @@ export default function App() {
}
```
-Now `Gallery.js` contains two exports: a default `Gallery` export, and a named `Profile` export. `App.js` imports both of them. Try editing `` to `` and back in this example:
+Nyní, `Gallery.js` obsahuje dva exporty, výchozí `Gallery` a jmenný `Profile`. `App.js` importuje oba dva. Zkuste upravit `` na `` a zpět v následujícím příkladu:
@@ -222,24 +222,24 @@ img { margin: 0 10px 10px 0; height: 90px; }
-Now you're using a mix of default and named exports:
+Nyní používáte mix výchozích a jmenných exportů:
* `Gallery.js`:
- - Exports the `Profile` component as a **named export called `Profile`.**
- - Exports the `Gallery` component as a **default export.**
+ - Exportuje komponentu `Profile` jako **jmenný export `Profile`.**
+ - Exportuje komponentu `Gallery` jako **výchozí export.**
* `App.js`:
- - Imports `Profile` as a **named import called `Profile`** from `Gallery.js`.
- - Imports `Gallery` as a **default import** from `Gallery.js`.
- - Exports the root `App` component as a **default export.**
+ - Importuje `Profile` jako **jmenný import `Profile`** z `Gallery.js`.
+ - Importuje `Gallery` jako **výchozí import** z `Gallery.js`.
+ - Exportuje kořenovou komponentu `App` jako **výchozí export.**
-On this page you learned:
+Na této stránce jste se naučili:
-* What a root component file is
-* How to import and export a component
-* When and how to use default and named imports and exports
-* How to export multiple components from the same file
+* Co je to soubor s kořenovou komponentou
+* Jak importovat a exportovat komponentu
+* Kdy a jak použít výchozí a jmenný import a export
+* Jak exportovat vícero komponent z jednoho souboru
@@ -247,22 +247,22 @@ On this page you learned:
-#### Split the components further {/*split-the-components-further*/}
+#### Další rozdělení komponent {/*split-the-components-further*/}
-Currently, `Gallery.js` exports both `Profile` and `Gallery`, which is a bit confusing.
+Nyní, `Gallery.js` exportuje obě komponenty `Profile` a `Gallery` což je trochu matoucí.
-Move the `Profile` component to its own `Profile.js`, and then change the `App` component to render both `` and `` one after another.
+Přesuňte komponentu `Profile` do vlastního souboru `Profile.js` a změňte komponentu `App` tak, aby rendrovala obě komponenty `` a `` v tomto pořadí.
-You may use either a default or a named export for `Profile`, but make sure that you use the corresponding import syntax in both `App.js` and `Gallery.js`! You can refer to the table from the deep dive above:
+Můžete použít buďto výchozí nebo jmenný export pro `Profile`, ale ujistěte se, že použijete korespondující syntaxi pro import v obou souborech `App.js` a `Gallery.js`! Můžete se podívat na tabulku z rozboru výše:
-| Syntax | Export statement | Import statement |
+| Syntaxe | Výraz pro export | Výraz pro import |
| ----------- | ----------- | ----------- |
-| Default | `export default function Button() {}` | `import Button from './Button.js';` |
-| Named | `export function Button() {}` | `import { Button } from './Button.js';` |
+| Výchozí | `export default function Button() {}` | `import Button from './Button.js';` |
+| Jmenný | `export function Button() {}` | `import { Button } from './Button.js';` |
-Don't forget to import your components where they are called. Doesn't `Gallery` use `Profile`, too?
+Nezapomeňte naimportovat vaše komponenty tam, kde je voláte. Nepoužívá komponenta `Gallery` komponentu `Profile` také?
@@ -282,7 +282,7 @@ export default function App() {
```
```js Gallery.js active
-// Move me to Profile.js!
+// Přesuň mne do Profile.js!
export function Profile() {
return (
-After you get it working with one kind of exports, make it work with the other kind.
+Jakmile to zvládnete s jedním typem exportu, zkuste to i s druhým.
-This is the solution with named exports:
+Toto je řešení s využitím jmenných exportů:
@@ -367,7 +367,7 @@ img { margin: 0 10px 10px 0; height: 90px; }
-This is the solution with default exports:
+Toto je řešení s využitím výchozí exportů: