Usage
After install this snippets add this inside your settings
"editor.snippetSuggestions": "top",
im [引入]
import React from react;
zs [注释]
/** */
dp [默认 props]
static defaultProps = {
name:
}
ds [默认 state]
readonly state = {
name:
}
gp [解构 props]
const { } = props;
gtp [解构 this.props]
const { } = this.props;
gs [解构 useState]
const [state, setState] = useState();
gts [解构 this.state]
const { } = this.state;
go [解构对象]
const { } = obj;
cs [setState]
this.setState({ });
ch [方法]
const handle = () => {
};
ph [私有方法]
private handle = () => {
}
tr [数据层]
try {
await handle()
} catch (e) {
console.error(e);
}
cl [className]
className=""
| |