Browse Source

[Beta] Remove unused prop from context examples (#5117)

* [Beta] remove unused prop from 'reducer-and-context' example

* [Beta] remove unused prop from useContext example

* [Beta] remove more more occurences of unused prop
main
Thomas Cleary 2 years ago
committed by GitHub
parent
commit
2a083f974c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/content/apis/react/useContext.md
  2. 8
      beta/src/content/learn/scaling-up-with-reducer-and-context.md

2
beta/src/content/apis/react/useContext.md

@ -797,7 +797,7 @@ const initialTasks = [
import { useState, useContext } from 'react';
import { useTasksDispatch } from './TasksContext.js';
export default function AddTask({ onAddTask }) {
export default function AddTask() {
const [text, setText] = useState('');
const dispatch = useTasksDispatch();
return (

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

@ -696,7 +696,7 @@ export default function TaskList() {
To update the task list, any component can read the `dispatch` function from context and call it:
```js {3,9-13}
export default function AddTask({ onAddTask }) {
export default function AddTask() {
const [text, setText] = useState('');
const dispatch = useContext(TasksDispatchContext);
// ...
@ -785,7 +785,7 @@ export const TasksDispatchContext = createContext(null);
import { useState, useContext } from 'react';
import { TasksDispatchContext } from './TasksContext.js';
export default function AddTask({ onAddTask }) {
export default function AddTask() {
const [text, setText] = useState('');
const dispatch = useContext(TasksDispatchContext);
return (
@ -1009,7 +1009,7 @@ const initialTasks = [
import { useState, useContext } from 'react';
import { TasksDispatchContext } from './TasksContext.js';
export default function AddTask({ onAddTask }) {
export default function AddTask() {
const [text, setText] = useState('');
const dispatch = useContext(TasksDispatchContext);
return (
@ -1228,7 +1228,7 @@ const initialTasks = [
import { useState } from 'react';
import { useTasksDispatch } from './TasksContext.js';
export default function AddTask({ onAddTask }) {
export default function AddTask() {
const [text, setText] = useState('');
const dispatch = useTasksDispatch();
return (

Loading…
Cancel
Save