@@ -12,13 +12,14 @@ export const validater = validate;
1212export interface InputPropsBase {
1313 name : string ;
1414 renderProps : FormikProps < any > ;
15- validater : ( value : string ) => string | undefined ;
15+ validater ? : ( value : string ) => string | undefined ;
1616 placeholder ?: string ;
1717}
1818
1919export interface InputProps extends InputPropsBase {
2020 size : "small" | "default" | "large" ;
2121 type : "password" | "text" | "email" ;
22+ defaultValue : string ;
2223}
2324
2425export function input ( props : InputProps ) {
@@ -34,7 +35,7 @@ export function input(props: InputProps) {
3435 size = { props . size }
3536 onBlur = { props . renderProps . handleBlur }
3637 onChange = { props . renderProps . handleChange }
37- defaultValue = { props . renderProps . values . password }
38+ defaultValue = { props . defaultValue }
3839 placeholder = { props . placeholder }
3940 />
4041 ) ;
@@ -46,6 +47,7 @@ export function input(props: InputProps) {
4647export interface TextAreaProps extends InputPropsBase {
4748 type : "password" | "text" | "email" ;
4849 rows : number ;
50+ defaultValue : string ;
4951}
5052
5153export function textArea ( props : TextAreaProps ) {
@@ -60,7 +62,7 @@ export function textArea(props: TextAreaProps) {
6062 name = { props . name }
6163 onBlur = { props . renderProps . handleBlur }
6264 onChange = { props . renderProps . handleChange }
63- defaultValue = { props . renderProps . values . password }
65+ defaultValue = { props . defaultValue }
6466 placeholder = { props . placeholder }
6567 rows = { props . rows }
6668 />
@@ -71,7 +73,6 @@ export function textArea(props: TextAreaProps) {
7173}
7274
7375export interface SelectInputProps extends InputPropsBase {
74- defaultValue : string | null ;
7576 options : { key : string ; value : string } [ ] ;
7677}
7778
0 commit comments