Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/a145789/vscode-quick-usestate

quick generate React useState code
https://github.com/a145789/vscode-quick-usestate

extension visual-studio-code vscode vscode-extension

Last synced: 29 days ago
JSON representation

quick generate React useState code

Awesome Lists containing this project

README

        

React Quick useState


Quick generate React useState code


Visual Studio Marketplace Version

# Usage

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

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

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

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

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

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

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