Skip to content

Commit 7138aa0

Browse files
authored
Rename state setter from useText to setText (#3281)
1 parent 1dd72bc commit 7138aa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/blog/2020-09-22-introducing-the-new-jsx-transform.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ For example,
241241
import React from 'react';
242242

243243
function App() {
244-
const [text, useText] = React.useState('Hello World');
244+
const [text, setText] = React.useState('Hello World');
245245
return <h1>{text}</h1>;
246246
}
247247
```
@@ -252,7 +252,7 @@ will be replaced with
252252
import { useState } from 'react';
253253

254254
function App() {
255-
const [text, useText] = useState('Hello World');
255+
const [text, setText] = useState('Hello World');
256256
return <h1>{text}</h1>;
257257
}
258258
```

0 commit comments

Comments
 (0)