ts-react-snippets
react typescript snippets
Snippet |
Purpose |
aa-cc |
React Class Component |
aa-cpc |
React Class PureComponent |
aa-fc |
React FunctionComponent |
example
aa-cc
import React from 'react'
type Props = {}
type State = {}
export class ComponentName extends React.Component<Props, State> {
render() {
}
}
aa-cpc
import React from 'react'
type Props = {}
type State = {}
export class ComponentName extends React.PureComponent<Props, State> {
render() {
}
}
aa-fc
import { FC } from 'react'
type Props = {}
export const ComponentName: FC<Props> = (props) => {
return (
)
}
| |