React Quick useState
Quick generate React useState code
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
| |