Browse Source

[Beta] Add TODO for some links (#5046)

* [Beta] Add TODO for some links

* [Beta] Update link
main
zqran 2 years ago
committed by GitHub
parent
commit
01d5c970bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      beta/src/content/learn/responding-to-events.md
  2. 4
      beta/src/content/learn/state-a-components-memory.md
  3. 2
      beta/src/content/learn/updating-arrays-in-state.md
  4. 2
      beta/src/content/learn/updating-objects-in-state.md

4
beta/src/content/learn/responding-to-events.md

@ -126,7 +126,7 @@ In both cases, what you want to pass is a function:
* `<button onClick={handleClick}>` passes the `handleClick` function.
* `<button onClick={() => alert('...')}>` passes the `() => alert('...')` function.
> Check out the [JavaScript Refresher](a-javascript-refresher#arrow-functions) for more on arrow functions.
> Check out the [JavaScript Refresher](TODO:/learn/a-javascript-refresher#arrow-functions) for more on arrow functions.
</Gotcha>
@ -231,7 +231,7 @@ If you use a [design system](https://uxdesign.cc/everything-you-need-to-know-abo
### Naming event handler props {/*naming-event-handler-props*/}
Built-in components like `<button>` and `<div>` only support [browser event names](/apis/react-dom/events) like `onClick`. However, when you're building your own components, you can name their event handler props any way that you like.
Built-in components like `<button>` and `<div>` only support [browser event names](TODO:/apis/react-dom/events) like `onClick`. However, when you're building your own components, you can name their event handler props any way that you like.
> By convention, event handler props should start with `on`, followed by a capital letter.

4
beta/src/content/learn/state-a-components-memory.md

@ -184,7 +184,7 @@ with
```js
const [index, setIndex] = useState(0);
````
```
`index` is a state variable and `setIndex` is the setter function.
@ -1448,7 +1448,7 @@ If your linter is [configured for React](/learn/editor-setup#linting), you shoul
When the button is clicked, this example should ask for the user's name and then display an alert greeting them. You tried to use state to keep the name, but for some reason it always shows "Hello, !".
To fix this code, remove the unnecessary state variable. (We will discuss about [why this didn't work](/learn/troubleshooting-state-updates#setting-state-does-not-update-variables) later.)
To fix this code, remove the unnecessary state variable. (We will discuss about [why this didn't work](/learn/state-as-a-snapshot) later.)
Can you explain why this state variable was unnecessary?

2
beta/src/content/learn/updating-arrays-in-state.md

@ -89,7 +89,7 @@ button { margin-left: 5px; }
</Sandpack>
Instead, create a *new* array which contains the existing items *and* a new item at the end. There are multiple ways to do this, but the easiest one is to use the `...` [array spread](a-javascript-refresher#array-spread) syntax:
Instead, create a *new* array which contains the existing items *and* a new item at the end. There are multiple ways to do this, but the easiest one is to use the `...` [array spread](TODO:/learn/a-javascript-refresher#array-spread) syntax:
```js
setArtists( // Replace the state

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

@ -283,7 +283,7 @@ setPerson({
});
```
You can use the `...` [object spread](a-javascript-refresher#object-spread) syntax so that you don't need to copy every property separately.
You can use the `...` [object spread](TODO:/learn/a-javascript-refresher#object-spread) syntax so that you don't need to copy every property separately.
```js
setPerson({

Loading…
Cancel
Save