Wei Zhu
7 years ago
committed by
Benjy Cui
4 changed files with 46 additions and 3 deletions
@ -1,5 +1,6 @@ |
|||
components/**/*.js |
|||
components/**/*.jsx |
|||
components/*/__tests__/type.tsx |
|||
!.eslintrc.js |
|||
!components/*/__tests__/* |
|||
!components/*/__tests__/**/*.js |
|||
!components/*/demo/* |
|||
|
@ -0,0 +1,36 @@ |
|||
/* tslint:disable */ |
|||
import React from 'react'; |
|||
import Form, { FormComponentProps } from '../Form'; |
|||
|
|||
// test Form.create on component without own props
|
|||
class WithoutOwnProps extends React.Component<any, any> { |
|||
state = { |
|||
foo: 'bar', |
|||
}; |
|||
render() { |
|||
return <div>foo</div>; |
|||
} |
|||
} |
|||
|
|||
const WithoutOwnPropsForm = Form.create()(WithoutOwnProps); |
|||
|
|||
<WithoutOwnPropsForm />; |
|||
|
|||
// test Form.create on component with own props
|
|||
interface WithOwnPropsProps extends FormComponentProps { |
|||
name: string; |
|||
} |
|||
|
|||
class WithOwnProps extends React.Component<WithOwnPropsProps, any> { |
|||
state = { |
|||
foo: 'bar', |
|||
}; |
|||
|
|||
render() { |
|||
return <div>foo</div>; |
|||
} |
|||
} |
|||
|
|||
const WithOwnPropsForm = Form.create()(WithOwnProps); |
|||
|
|||
<WithOwnPropsForm name="foo" />; |
Loading…
Reference in new issue