Simple collection of React-TypeScript Snippets.
Trigger | Content |
---|---|
imr→ |
import React |
imrd→ |
import ReactDOM |
Trigger | Content |
---|---|
cc→ |
class component |
ccp→ |
class component with Props |
ccs→ |
class component with State |
ccc→ |
constructor() {…} |
sfc→ |
stateless function component |
sfcp→ |
stateless function component with Props |
cwm→ |
componentWillMount() {…} |
cdm→ |
componentDidMount() {…} |
cwr→ |
componentWillReceiveProps() {…} |
scu→ |
shouldComponentUpdate() {…} |
cwu→ |
componentWillUpdate() {…} |
cdu→ |
componentDidUpdate() {…} |
cwun→ |
componentWillUnmount() {…} |
ss→ |
this.setState({…}) |
ssf→ |
this.setState(() => {…}) |
dp→ |
defaultProps = {…} |
refs→ |
refs: {…} |
import * as React from 'react';
import [* as ReactDOM] from 'react-dom';
export class [FileName] extends React.Component<{}, {}> {
render() {
return …
}
}
interface Props {}
export class [FileName] extends React.Component<Props, {}> {
render() {
return …
}
}
interface Props {}
interface State {}
export class [FileName] extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {};
}
render() {
return …
}
}
constructor(props: Props) {
super(props);
…
}
export const [FileName]: React.SFC<{}> = () => {
return …
};
interface Props {}
export const [FileName]: React.SFC<Props> = props => {
return …
};
componentWillMount(): void {
…
}
componentDidMount(): void {
…
}
componentWillReceiveProps(nextProps: Props): void {
…
}
shouldComponentUpdate(nextProps: Props, nextState: State): boolean {
…
}
componentWillUpdate(nextProps: Props, nextState: State): void {
…
}
componentDidUpdate(prevProps: Props, prevState: State): void {
…
}
componentWillUnmount(): void {
…
}
this.setState({ … });
this.setState((prevState: State, props: Props) => {
…
});
[const|static] defaultProps: Partial<Props> = {
…
};
refs: {
[key: string]: Element;
…
};
vscode-snippets's People
vscode-snippets's Issues
typescript无法提示
TS terminated unexpectedly, unable to give syntax prompt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.