parent
0185aa5eec
commit
0df8bf9445
4 changed files with 81 additions and 3 deletions
@ -0,0 +1,51 @@ |
||||
{ |
||||
"New Functional Component": { |
||||
"scope": "typescriptreact", |
||||
"prefix": "fc", |
||||
"body": [ |
||||
"type Props = {}", |
||||
"", |
||||
"export const $1 = (props: Props) => {", |
||||
" return <p>$2</p>", |
||||
"}" |
||||
], |
||||
"description": "React Component w/props" |
||||
}, |
||||
"New Functional Route Component": { |
||||
"scope": "typescriptreact", |
||||
"prefix": "fc-routed", |
||||
"body": [ |
||||
"import { RouteComponentProps } from 'react-router'", |
||||
"type Props = RouteComponentProps", |
||||
"", |
||||
"export const $1 = ({match}: Props) => {", |
||||
" return <p>$2</p>", |
||||
"}" |
||||
], |
||||
"description": "React Routed Component" |
||||
}, |
||||
"New Page Component": { |
||||
"scope": "typescriptreact", |
||||
"prefix": "fc-page", |
||||
"body": [ |
||||
"export const $1 = () => {", |
||||
" return <p>$2</p>", |
||||
"}" |
||||
], |
||||
"description": "React Page Component No Props" |
||||
}, |
||||
"New Form Component": { |
||||
"scope": "typescriptreact", |
||||
"prefix": "fc-form", |
||||
"body": [ |
||||
"import { Form, Input, Layout } from 'antd'", |
||||
"", |
||||
"export const $1 = () => {", |
||||
" const [form] = Form.useForm()", |
||||
" return <Form form={form}>$2</Form>", |
||||
"}" |
||||
], |
||||
"description": "React Page Component No Props" |
||||
|
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
import { Form, Input, Layout } from 'antd' |
||||
import { User } from '../../types' |
||||
|
||||
export const NewUser = () => { |
||||
const [form] = Form.useForm<User>() |
||||
|
||||
return ( |
||||
<Form form={form}> |
||||
<Form.Item label="username" name="name"> |
||||
<Input></Input> |
||||
</Form.Item> |
||||
</Form> |
||||
) |
||||
} |
Loading…
Reference in new issue