Skip to content

Commit 92378a7

Browse files
committed
chore: merge conflicts
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
1 parent e8114c2 commit 92378a7

File tree

3 files changed

+37
-53
lines changed

3 files changed

+37
-53
lines changed

src/content/learn/thinking-in-react.md

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,11 @@ Nello step precedente, hai identificato due pezzi di state in questa applicazion
265265

266266
Adesso eseguiamo la nostra strategia per essi:
267267

268-
<<<<<<< HEAD
269268
1. **Identifica i componenti che usano lo state:**
270269
* `ProductTable` ha bisogno di filtrare la lista dei prodotti in base a quei valori di state (testo di ricerca e valore della checkbox).
271270
* `SearchBar` ha bisogno di mostrare lo state (testo di ricerca e valore della checkbox).
272-
1. **Trova il loro genitore comune:** Il primo componente genitore che entrambi i componenti condividono è `FilterableProductTable`.
273-
2. **Decidi dove vive lo state**: Terremo i valori dello state del testo del filtro e della checkbox in `FilterableProductTable`.
274-
=======
275-
1. **Identify components that use state:**
276-
* `ProductTable` needs to filter the product list based on that state (search text and checkbox value).
277-
* `SearchBar` needs to display that state (search text and checkbox value).
278-
2. **Find their common parent:** The first parent component both components share is `FilterableProductTable`.
279-
3. **Decide where the state lives**: We'll keep the filter text and checked state values in `FilterableProductTable`.
280-
>>>>>>> 1697ae89a3bbafd76998dd7496754e5358bc1e9a
271+
2. **Trova il loro genitore comune:** Il primo componente genitore che entrambi i componenti condividono è `FilterableProductTable`.
272+
3. **Decidi dove vive lo state**: Terremo i valori dello state del testo del filtro e della checkbox in `FilterableProductTable`.
281273

282274
Quindi i valori di state vivranno in `FilterableProductTable`.
283275

@@ -286,17 +278,17 @@ Aggiungi lo state al componente con l'[Hook `useState()`.](/reference/react/useS
286278
```js
287279
function FilterableProductTable({ products }) {
288280
const [filterText, setFilterText] = useState('');
289-
const [inStockOnly, setInStockOnly] = useState(false);
281+
const [inStockOnly, setInStockOnly] = useState(false);
290282
```
291283
292284
Poi, passa `filterText` e `inStockOnly` a `ProductTable` e `SearchBar` come props:
293285
294286
```js
295287
<div>
296-
<SearchBar
297-
filterText={filterText}
288+
<SearchBar
289+
filterText={filterText}
298290
inStockOnly={inStockOnly} />
299-
<ProductTable
291+
<ProductTable
300292
products={products}
301293
filterText={filterText}
302294
inStockOnly={inStockOnly} />
@@ -316,10 +308,10 @@ function FilterableProductTable({ products }) {
316308

317309
return (
318310
<div>
319-
<SearchBar
320-
filterText={filterText}
311+
<SearchBar
312+
filterText={filterText}
321313
inStockOnly={inStockOnly} />
322-
<ProductTable
314+
<ProductTable
323315
products={products}
324316
filterText={filterText}
325317
inStockOnly={inStockOnly} />
@@ -397,13 +389,13 @@ function ProductTable({ products, filterText, inStockOnly }) {
397389
function SearchBar({ filterText, inStockOnly }) {
398390
return (
399391
<form>
400-
<input
401-
type="text"
402-
value={filterText}
392+
<input
393+
type="text"
394+
value={filterText}
403395
placeholder="Search..."/>
404396
<label>
405-
<input
406-
type="checkbox"
397+
<input
398+
type="checkbox"
407399
checked={inStockOnly} />
408400
{' '}
409401
Only show products in stock
@@ -459,9 +451,9 @@ Nel sandbox sopra, `ProductTable` e `SearchBar` leggono le props `filterText` e
459451
function SearchBar({ filterText, inStockOnly }) {
460452
return (
461453
<form>
462-
<input
463-
type="text"
464-
value={filterText}
454+
<input
455+
type="text"
456+
value={filterText}
465457
placeholder="Search..."/>
466458
```
467459
@@ -482,8 +474,8 @@ function FilterableProductTable({ products }) {
482474

483475
return (
484476
<div>
485-
<SearchBar
486-
filterText={filterText}
477+
<SearchBar
478+
filterText={filterText}
487479
inStockOnly={inStockOnly}
488480
onFilterTextChange={setFilterText}
489481
onInStockOnlyChange={setInStockOnly} />
@@ -526,13 +518,13 @@ function FilterableProductTable({ products }) {
526518

527519
return (
528520
<div>
529-
<SearchBar
530-
filterText={filterText}
531-
inStockOnly={inStockOnly}
532-
onFilterTextChange={setFilterText}
521+
<SearchBar
522+
filterText={filterText}
523+
inStockOnly={inStockOnly}
524+
onFilterTextChange={setFilterText}
533525
onInStockOnlyChange={setInStockOnly} />
534-
<ProductTable
535-
products={products}
526+
<ProductTable
527+
products={products}
536528
filterText={filterText}
537529
inStockOnly={inStockOnly} />
538530
</div>
@@ -614,14 +606,14 @@ function SearchBar({
614606
}) {
615607
return (
616608
<form>
617-
<input
618-
type="text"
619-
value={filterText} placeholder="Search..."
609+
<input
610+
type="text"
611+
value={filterText} placeholder="Search..."
620612
onChange={(e) => onFilterTextChange(e.target.value)} />
621613
<label>
622-
<input
623-
type="checkbox"
624-
checked={inStockOnly}
614+
<input
615+
type="checkbox"
616+
checked={inStockOnly}
625617
onChange={(e) => onInStockOnlyChange(e.target.checked)} />
626618
{' '}
627619
Only show products in stock

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,11 +1133,7 @@ Chiamare la funzione `setSquares` consente a React di sapere che lo stato del co
11331133
11341134
<Note>
11351135
1136-
<<<<<<< HEAD
11371136
JavaScript supporta le [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures), il che significa che una funzione interna (ad es. `handleClick`) ha accesso a variabili e funzioni definite in una funzione esterna (ad es. `Board`). La funzione `handleClick` può leggere lo state `squares` e chiamare il metodo `setSquares` perché sono entrambi definiti all'interno della funzione `Board`.
1138-
=======
1139-
JavaScript supports [closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures) which means an inner function (e.g. `handleClick`) has access to variables and functions defined in an outer function (e.g. `Board`). The `handleClick` function can read the `squares` state and call the `setSquares` method because they are both defined inside of the `Board` function.
1140-
>>>>>>> 1697ae89a3bbafd76998dd7496754e5358bc1e9a
11411137
11421138
</Note>
11431139

src/content/learn/updating-objects-in-state.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ setPosition({
199199

200200
Mutare è un problema solo quando modifichi oggetti *esistenti* che sono già nello state. Mutare un oggetto che hai appena creato va bene perché *nessun altro codice lo utilizza ancora.* Modificarlo non impatterà accidentalmente qualcosa che dipende da esso. Questa si definisce come "mutazione locale". Puoi persino mutare localmente [durante la renderizzazione.](/learn/keeping-components-pure#local-mutation-your-components-little-secret) Molto comodo e perfettamente valido!
201201

202-
</DeepDive>
202+
</DeepDive>
203203

204204
## Copiare gli oggetti con la sintassi di spread {/*copying-objects-with-the-spread-syntax*/}
205205

@@ -379,11 +379,7 @@ Nota che la sintassi di spread `...` è "superficiale", cioè copia solo il prim
379379

380380
#### Usare un singolo event handler per più campi {/*using-a-single-event-handler-for-multiple-fields*/}
381381

382-
<<<<<<< HEAD
383382
Puoi anche usare le parentesi `[` e `]` dentro alla definizione dell'oggetto per specificare una proprietà con nome dinamico. Ecco lo stesso esempio, ma con un solo event handler invece di tre:
384-
=======
385-
You can also use the `[` and `]` braces inside your object definition to specify a property with a dynamic name. Here is the same example, but with a single event handler instead of three different ones:
386-
>>>>>>> 1697ae89a3bbafd76998dd7496754e5358bc1e9a
387383

388384
<Sandpack>
389385

@@ -583,8 +579,8 @@ export default function Form() {
583579
<br />
584580
(located in {person.artwork.city})
585581
</p>
586-
<img
587-
src={person.artwork.image}
582+
<img
583+
src={person.artwork.image}
588584
alt={person.artwork.title}
589585
/>
590586
</>
@@ -654,7 +650,7 @@ let obj3 = {
654650

655651
Se dovessi mutare `obj3.artwork.city`, questo impatterebbe sia `obj2.artwork.city` che `obj1.city`. Questo perché `obj3.artwork`, `obj2.artwork` e `obj1` sono lo stesso oggetto. Questo è difficile da capire quando pensi agli oggetti come "nidificati". Invece, sono oggetti separati che si "puntano" a vicenda tramite le proprietà.
656652

657-
</DeepDive>
653+
</DeepDive>
658654

659655
### Scrivi logica di aggiornamento concisa con Immer {/*write-concise-update-logic-with-immer*/}
660656

@@ -759,8 +755,8 @@ export default function Form() {
759755
<br />
760756
(located in {person.artwork.city})
761757
</p>
762-
<img
763-
src={person.artwork.image}
758+
<img
759+
src={person.artwork.image}
764760
alt={person.artwork.title}
765761
/>
766762
</>

0 commit comments

Comments
 (0)