Skip to content

Commit a3ea1ff

Browse files
authored
Update documentation on state variable usage
Clarified example of updating state based on props or state in the documentation.
1 parent 7e8db7e commit a3ea1ff

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/content/learn/you-might-not-need-an-effect.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ To help you gain the right intuition, let's look at some common concrete example
3434

3535
Suppose you have a component with two state variables: `firstName` and `lastName`. You want to calculate a `fullName` from them by concatenating them. Moreover, you'd like `fullName` to update whenever `firstName` or `lastName` change. Your first instinct might be to add a `fullName` state variable and update it in an Effect:
3636

37-
```js {expectedErrors: {'react-compiler': [8]}} {5-9}
3837
```js {5-9}
3938
function Form() {
4039
const [firstName, setFirstName] = useState('Taylor');

0 commit comments

Comments
 (0)