Browse Source

Rename state setter from useText to setText (#3281)

main
Sandro Miguel Marques 4 years ago
committed by GitHub
parent
commit
7138aa016f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      content/blog/2020-09-22-introducing-the-new-jsx-transform.md

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

@ -241,7 +241,7 @@ For example,
import React from 'react'; import React from 'react';
function App() { function App() {
const [text, useText] = React.useState('Hello World'); const [text, setText] = React.useState('Hello World');
return <h1>{text}</h1>; return <h1>{text}</h1>;
} }
``` ```
@ -252,7 +252,7 @@ will be replaced with
import { useState } from 'react'; import { useState } from 'react';
function App() { function App() {
const [text, useText] = useState('Hello World'); const [text, setText] = useState('Hello World');
return <h1>{text}</h1>; return <h1>{text}</h1>;
} }
``` ```

Loading…
Cancel
Save