Skip to content

Commit 3c1ea35

Browse files
committed
wip: translation
1 parent bde01eb commit 3c1ea35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/content/learn/javascript-in-jsx-with-curly-braces.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ export default function TodoList() {
111111
112112
</Sandpack>
113113
114-
### Where to use curly braces {/*where-to-use-curly-braces*/}
114+
### Kde použít složené závorky {/*where-to-use-curly-braces*/}
115115
116-
You can only use curly braces in two ways inside JSX:
116+
Jsou dva způsoby, jak použít složené závorky v JSX:
117117
118-
1. **As text** directly inside a JSX tag: `<h1>{name}'s To Do List</h1>` works, but `<{tag}>Gregorio Y. Zara's To Do List</{tag}>` will not.
119-
2. **As attributes** immediately following the `=` sign: `src={avatar}` will read the `avatar` variable, but `src="{avatar}"` will pass the string `"{avatar}"`.
118+
1. **Jako text** přímo v JSX tagu: `<h1>{name}'s To Do List</h1>` funguje, ale `<{tag}>Gregorio Y. Zara's To Do List</{tag}>` nebude fungovat.
119+
2. **Jako atribut** ihned po `=` znaku: `src={avatar}` přečte `avatar` proměnnou, ale `src="{avatar}"` bude předáno jako řetězec `"{avatar}"`.
120120
121-
## Using "double curlies": CSS and other objects in JSX {/*using-double-curlies-css-and-other-objects-in-jsx*/}
121+
## Používání "dvojitých složených závorek": CSS a ostatní objekty v JSX {/*using-double-curlies-css-and-other-objects-in-jsx*/}
122122
123123
In addition to strings, numbers, and other JavaScript expressions, you can even pass objects in JSX. Objects are also denoted with curly braces, like `{ name: "Hedy Lamarr", inventions: 5 }`. Therefore, to pass a JS object in JSX, you must wrap the object in another pair of curly braces: `person={{ name: "Hedy Lamarr", inventions: 5 }}`.
124124

0 commit comments

Comments
 (0)