Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>React Quick useStateNew to Visual Studio Code? Get it now.

React Quick useState

clencat

|
186 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

React Quick useState

Quick generate React useState code

Visual Studio Marketplace Version

Usage

Enter const to open the prompt, use / to split code.

// input 
const count/0
// output
const [count, setCount] = useState(0)

// input 
const name/string/'John'
// output
const [name, setName] = useState<string>('John')

// input 
const arr/number[]/[]
// output
const [arr, setArr] = useState<number[]>([])

// input 
const fooBar/Foo | Bar/'foo'
// output
const [fooBar, setFooBar] = useState<Foo | Bar>('foo')

如果没显示提示,请键入 / 字符开启提示

If no prompt is displayed, type the character / to enable the prompt

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft