Skip to content

Commit 75db8f2

Browse files
authored
[Beta] Rename TaskBoard -> TaskApp in examples (#4271)
* [Beta] Rename TaskBoard -> TaskApp in examples * Update another page * Update another page * Update another page * Update another page
1 parent 42576e0 commit 75db8f2

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

beta/src/pages/learn/extracting-state-logic-into-a-reducer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Components with many state updates spread across many event handlers can get ove
1919

2020
## Consolidate state logic with a reducer {/*consolidate-state-logic-with-a-reducer*/}
2121

22-
As your components grow in complexity, it can get harder to see all the different ways that a component's state gets updated at a glance. For example, the `TaskBoard` component below holds an array of `tasks` in state and uses three different event handlers to add, remove, and edit tasks:
22+
As your components grow in complexity, it can get harder to see all the different ways that a component's state gets updated at a glance. For example, the `TaskApp` component below holds an array of `tasks` in state and uses three different event handlers to add, remove, and edit tasks:
2323

2424
<Sandpack>
2525

@@ -28,7 +28,7 @@ import { useState } from 'react';
2828
import AddTask from './AddTask.js';
2929
import TaskList from './TaskList.js';
3030

31-
export default function TaskBoard() {
31+
export default function TaskApp() {
3232
const [tasks, setTasks] = useState(initialTasks);
3333

3434
function handleAddTask(text) {
@@ -492,7 +492,7 @@ import { useReducer } from 'react';
492492
import AddTask from './AddTask.js';
493493
import TaskList from './TaskList.js';
494494

495-
export default function TaskBoard() {
495+
export default function TaskApp() {
496496
const [tasks, dispatch] = useReducer(
497497
tasksReducer,
498498
initialTasks
@@ -682,7 +682,7 @@ import AddTask from './AddTask.js';
682682
import TaskList from './TaskList.js';
683683
import tasksReducer from './tasksReducer.js';
684684

685-
export default function TaskBoard() {
685+
export default function TaskApp() {
686686
const [tasks, dispatch] = useReducer(
687687
tasksReducer,
688688
initialTasks
@@ -925,7 +925,7 @@ function tasksReducer(draft, action) {
925925
}
926926
}
927927

928-
export default function TaskBoard() {
928+
export default function TaskApp() {
929929
const [tasks, dispatch] = useImmerReducer(
930930
tasksReducer,
931931
initialTasks
@@ -2804,4 +2804,4 @@ This is because the dispatched actions are queued until the next render, [simila
28042804
28052805
</Solution>
28062806
2807-
</Challenges>
2807+
</Challenges>

beta/src/pages/learn/managing-state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ import { useReducer } from 'react';
511511
import AddTask from './AddTask.js';
512512
import TaskList from './TaskList.js';
513513

514-
export default function TaskBoard() {
514+
export default function TaskApp() {
515515
const [tasks, dispatch] = useReducer(
516516
tasksReducer,
517517
initialTasks
@@ -812,7 +812,7 @@ import AddTask from './AddTask.js';
812812
import TaskList from './TaskList.js';
813813
import { TasksProvider } from './TasksContext.js';
814814

815-
export default function TaskBoard() {
815+
export default function TaskApp() {
816816
return (
817817
<TasksProvider>
818818
<h1>Day off in Kyoto</h1>

beta/src/pages/learn/scaling-up-with-reducer-and-context.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { useReducer } from 'react';
2727
import AddTask from './AddTask.js';
2828
import TaskList from './TaskList.js';
2929

30-
export default function TaskBoard() {
30+
export default function TaskApp() {
3131
const [tasks, dispatch] = useReducer(
3232
tasksReducer,
3333
initialTasks
@@ -207,9 +207,9 @@ ul, li { margin: 0; padding: 0; }
207207

208208
</Sandpack>
209209

210-
A reducer helps keep the event handlers short and concise. However, as your app grows, you might run into another difficulty. **Currently, the `tasks` state and the `dispatch` function are only available in the top-level `TaskBoard` component.** To let other components read the list of tasks or change it, you have to explicitly [pass down](/learn/passing-props-to-a-component) the current state and the event handlers that change it as props.
210+
A reducer helps keep the event handlers short and concise. However, as your app grows, you might run into another difficulty. **Currently, the `tasks` state and the `dispatch` function are only available in the top-level `TaskApp` component.** To let other components read the list of tasks or change it, you have to explicitly [pass down](/learn/passing-props-to-a-component) the current state and the event handlers that change it as props.
211211

212-
For example, `TaskBoard` passes a list of tasks and the event handlers to `TaskList`:
212+
For example, `TaskApp` passes a list of tasks and the event handlers to `TaskList`:
213213

214214
```js
215215
<TaskList
@@ -233,7 +233,7 @@ In a small example like this, this works well, but if you have tens or hundreds
233233

234234
<!--(TODO: illustration of prop drilling)-->
235235

236-
This is why, as an alternative to passing them through props, you might want to put both the `tasks` state and the `dispatch` function [into context](/learn/passing-data-deeply-with-context). **This way, any component below `TaskBoard` in the tree can read the tasks and dispatch actions without the repetitive "prop drilling".**
236+
This is why, as an alternative to passing them through props, you might want to put both the `tasks` state and the `dispatch` function [into context](/learn/passing-data-deeply-with-context). **This way, any component below `TaskApp` in the tree can read the tasks and dispatch actions without the repetitive "prop drilling".**
237237

238238
<!--(TODO: illustration of context)-->
239239

@@ -265,7 +265,7 @@ import { useReducer } from 'react';
265265
import AddTask from './AddTask.js';
266266
import TaskList from './TaskList.js';
267267

268-
export default function TaskBoard() {
268+
export default function TaskApp() {
269269
const [tasks, dispatch] = useReducer(
270270
tasksReducer,
271271
initialTasks
@@ -452,16 +452,16 @@ ul, li { margin: 0; padding: 0; }
452452

453453
</Sandpack>
454454

455-
Here, you're passing `null` as the default value to both contexts. The actual values will be provided by the `TaskBoard` component.
455+
Here, you're passing `null` as the default value to both contexts. The actual values will be provided by the `TaskApp` component.
456456

457457
### Step 2: Put state and dispatch into context {/*step-2-put-state-and-dispatch-into-context*/}
458458

459-
Now you can import both contexts in your `TaskBoard` component. Take the `tasks` and `dispatch` returned by `useReducer()` and [provide them](/learn/passing-data-deeply-with-context#step-3-provide-the-context) to the entire tree below:
459+
Now you can import both contexts in your `TaskApp` component. Take the `tasks` and `dispatch` returned by `useReducer()` and [provide them](/learn/passing-data-deeply-with-context#step-3-provide-the-context) to the entire tree below:
460460

461461
```js {4,7-8}
462462
import { TasksContext, TasksDispatchContext } from './TasksContext.js';
463463

464-
export default function TaskBoard() {
464+
export default function TaskApp() {
465465
const [tasks, dispatch] = useReducer(tasksReducer, initialTasks);
466466
// ...
467467
return (
@@ -484,7 +484,7 @@ import AddTask from './AddTask.js';
484484
import TaskList from './TaskList.js';
485485
import { TasksContext, TasksDispatchContext } from './TasksContext.js';
486486

487-
export default function TaskBoard() {
487+
export default function TaskApp() {
488488
const [tasks, dispatch] = useReducer(
489489
tasksReducer,
490490
initialTasks
@@ -717,7 +717,7 @@ export default function AddTask({ onAddTask }) {
717717
// ...
718718
```
719719
720-
**The `TaskBoard` component does not pass any event handlers down, and the `TaskList` does not pass any event handlers to the `Task` component either.** Each component reads the context that it needs:
720+
**The `TaskApp` component does not pass any event handlers down, and the `TaskList` does not pass any event handlers to the `Task` component either.** Each component reads the context that it needs:
721721
722722
<Sandpack>
723723
@@ -727,7 +727,7 @@ import AddTask from './AddTask.js';
727727
import TaskList from './TaskList.js';
728728
import { TasksContext, TasksDispatchContext } from './TasksContext.js';
729729

730-
export default function TaskBoard() {
730+
export default function TaskApp() {
731731
const [tasks, dispatch] = useReducer(
732732
tasksReducer,
733733
initialTasks
@@ -901,7 +901,7 @@ ul, li { margin: 0; padding: 0; }
901901
902902
</Sandpack>
903903
904-
**The state still "lives" in the top-level `TaskBoard` 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.
904+
**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.
905905
906906
## Moving all wiring into a single file {/*moving-all-wiring-into-a-single-file*/}
907907
@@ -934,7 +934,7 @@ export function TasksProvider({ children }) {
934934
}
935935
```
936936
937-
**This removes all the complexity and wiring from your `TaskBoard` component:**
937+
**This removes all the complexity and wiring from your `TaskApp` component:**
938938
939939
<Sandpack>
940940
@@ -943,7 +943,7 @@ import AddTask from './AddTask.js';
943943
import TaskList from './TaskList.js';
944944
import { TasksProvider } from './TasksContext.js';
945945

946-
export default function TaskBoard() {
946+
export default function TaskApp() {
947947
return (
948948
<TasksProvider>
949949
<h1>Day off in Kyoto</h1>
@@ -1153,7 +1153,7 @@ import AddTask from './AddTask.js';
11531153
import TaskList from './TaskList.js';
11541154
import { TasksProvider } from './TasksContext.js';
11551155

1156-
export default function TaskBoard() {
1156+
export default function TaskApp() {
11571157
return (
11581158
<TasksProvider>
11591159
<h1>Day off in Kyoto</h1>

beta/src/pages/learn/updating-arrays-in-state.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ const initialTodos = [
10981098
{ id: 2, title: 'Brew tea', done: false },
10991099
];
11001100

1101-
export default function TaskBoard() {
1101+
export default function TaskApp() {
11021102
const [todos, setTodos] = useState(
11031103
initialTodos
11041104
);
@@ -1261,7 +1261,7 @@ const initialTodos = [
12611261
{ id: 2, title: 'Brew tea', done: false },
12621262
];
12631263

1264-
export default function TaskBoard() {
1264+
export default function TaskApp() {
12651265
const [todos, setTodos] = useState(
12661266
initialTodos
12671267
);
@@ -1432,7 +1432,7 @@ const initialTodos = [
14321432
{ id: 2, title: 'Brew tea', done: false },
14331433
];
14341434

1435-
export default function TaskBoard() {
1435+
export default function TaskApp() {
14361436
const [todos, setTodos] = useState(
14371437
initialTodos
14381438
);
@@ -1614,7 +1614,7 @@ const initialTodos = [
16141614
{ id: 2, title: 'Brew tea', done: false },
16151615
];
16161616

1617-
export default function TaskBoard() {
1617+
export default function TaskApp() {
16181618
const [todos, updateTodos] = useImmer(
16191619
initialTodos
16201620
);
@@ -1802,7 +1802,7 @@ const initialTodos = [
18021802
{ id: 2, title: 'Brew tea', done: false },
18031803
];
18041804

1805-
export default function TaskBoard() {
1805+
export default function TaskApp() {
18061806
const [todos, updateTodos] = useImmer(
18071807
initialTodos
18081808
);

beta/src/pages/reference/usestate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ const initialTodos = [
266266
{ id: 2, title: 'Brew tea', done: false },
267267
];
268268

269-
export default function TaskBoard() {
269+
export default function TaskApp() {
270270
const [todos, setTodos] = useState(initialTodos);
271271

272272
function handleAddTodo(title) {

0 commit comments

Comments
 (0)