Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
deblasis
requested changes
Mar 24, 2025
Collaborator
deblasis
left a comment
There was a problem hiding this comment.
Perdona il ritardo! 🙈
Qualche piccola correzione
| </Sandpack> | ||
|
|
||
| **The state still "lives" in the top-level `TaskApp` component, managed with `useReducer`.** But its `tasks` and `dispatch` are now available to every component below in the tree by importing and using these contexts. | ||
| **Lo stato ancora "vive" nel componente di primo livello `TaskApp`, gestito con `useReducer`.** Ma i suoi `tasks` e `dispatch` sono ora disponibili ad ogni componente nell'albero sottostante semplicemente importando e usando questi context. |
Collaborator
There was a problem hiding this comment.
Cosa ne pensi?
Suggested change
| **Lo stato ancora "vive" nel componente di primo livello `TaskApp`, gestito con `useReducer`.** Ma i suoi `tasks` e `dispatch` sono ora disponibili ad ogni componente nell'albero sottostante semplicemente importando e usando questi context. | |
| **Lo stato continua a "vivere" nel componente di primo livello `TaskApp`, gestito con `useReducer`.** Ma i suoi `tasks` e `dispatch` sono ora disponibili ad ogni componente nell'albero sottostante semplicemente importando e usando questi context. |
Comment on lines
+176
to
+178
| "tags": [ | ||
| "advanced" | ||
| ], |
Collaborator
There was a problem hiding this comment.
Suggested change
| "tags": [ | |
| "advanced" | |
| ], | |
| "tags": ["advanced"], |
Comment on lines
+139
to
+141
| "tags": [ | ||
| "intermediate" | ||
| ], |
Collaborator
There was a problem hiding this comment.
Suggested change
| "tags": [ | |
| "intermediate" | |
| ], | |
| "tags": ["intermediate"], |
| - Puoi esportare un componente come `TasksProvider` che fornisce il context. | ||
| - Puoi anche esportare dei Ganci personalizzati come `useTasks` e `useTasksDispatch` per leggerlo. | ||
| - Puoi avere molte coppie context-reducer come questa nella tua app. | ||
| - |
| ### Passo 1: Crea il context {/*step-1-create-the-context*/} | ||
|
|
||
| The `useReducer` Hook returns the current `tasks` and the `dispatch` function that lets you update them: | ||
| Il gancio `useReducer` ritorna le `tasks` attuali e la funzione `dispatch` che ti permette di aggiornarle: |
Collaborator
There was a problem hiding this comment.
Suggested change
| Il gancio `useReducer` ritorna le `tasks` attuali e la funzione `dispatch` che ti permette di aggiornarle: | |
| L'hook `useReducer` ritorna le `tasks` attuali e la funzione `dispatch` che ti permette di aggiornarle: |
| <Note> | ||
|
|
||
| Functions like `useTasks` and `useTasksDispatch` are called *[Custom Hooks.](/learn/reusing-logic-with-custom-hooks)* Your function is considered a custom Hook if its name starts with `use`. This lets you use other Hooks, like `useContext`, inside it. | ||
| Funzioni come `useTasks` e `useTasksDispatch` sono chiamate *[Ganci Personalizzati.](/learn/reusing-logic-with-custom-hooks)* La tua funzione è considerata un Gancio personalizzato se il nome comincia con `use`. Questo ti permette di usare altri Ganci, tipo `useContext`, dentro di esso. |
Collaborator
There was a problem hiding this comment.
Suggested change
| Funzioni come `useTasks` e `useTasksDispatch` sono chiamate *[Ganci Personalizzati.](/learn/reusing-logic-with-custom-hooks)* La tua funzione è considerata un Gancio personalizzato se il nome comincia con `use`. Questo ti permette di usare altri Ganci, tipo `useContext`, dentro di esso. | |
| Funzioni come `useTasks` e `useTasksDispatch` sono chiamate *[Hooks Personalizzati.](/learn/reusing-logic-with-custom-hooks)* La tua funzione è considerata un Hook personalizzato se il nome comincia con `use`. Questo ti permette di usare altri Hooks, tipo `useContext`, dentro di esso. |
| 3. Usa uno dei due context dai componente che ne hanno bisogno per leggerli. | ||
| - Puoi ulteriormente ordinare i componenti muovendo tutte le connessioni in un unico file. | ||
| - Puoi esportare un componente come `TasksProvider` che fornisce il context. | ||
| - Puoi anche esportare dei Ganci personalizzati come `useTasks` e `useTasksDispatch` per leggerlo. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - Puoi anche esportare dei Ganci personalizzati come `useTasks` e `useTasksDispatch` per leggerlo. | |
| - Puoi anche esportare degli Hooks personalizzati come `useTasks` e `useTasksDispatch` per leggerlo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are a few words that I'm not sure whether I can translate or not but I'm looking forward to the review to see if there's something that can be improved