@@ -280,13 +280,14 @@ describe("useField", () => {
280280const { input} = useField ( name , {
281281subscription :{ value :true } ,
282282 formatOnBlur,
283+ defaultValue :"" ,
283284} ) ;
284285const { onChange, onFocus, onBlur} = input ;
285286spy ( onChange , onFocus , onBlur ) ;
286- return < input { ...input } /> ;
287+ return < input { ...input } value = { input . value || "" } /> ;
287288} ;
288289const { rerender} = render (
289- < Form onSubmit = { onSubmitMock } >
290+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
290291{ ( ) => (
291292< form >
292293< MyField name = "myField" />
@@ -301,7 +302,7 @@ describe("useField", () => {
301302expect ( spy . mock . calls [ 1 ] [ 2 ] ) . toBe ( spy . mock . calls [ 0 ] [ 2 ] ) ; // onBlur
302303
303304rerender (
304- < Form onSubmit = { onSubmitMock } >
305+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
305306{ ( ) => (
306307< form >
307308< MyField name = "dog" formatOnBlur />
@@ -325,13 +326,14 @@ describe("useField", () => {
325326const { input} = useField ( name , {
326327subscription :{ value :true } ,
327328 parse,
329+ defaultValue :"" ,
328330} ) ;
329331const { onChange, onFocus, onBlur} = input ;
330332spy ( onChange , onFocus , onBlur ) ;
331- return < input { ...input } /> ;
333+ return < input { ...input } value = { input . value || "" } /> ;
332334} ;
333335const { rerender} = render (
334- < Form onSubmit = { onSubmitMock } >
336+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
335337{ ( ) => (
336338< form >
337339< MyField name = "myField" />
@@ -346,7 +348,7 @@ describe("useField", () => {
346348expect ( spy . mock . calls [ 1 ] [ 2 ] ) . toBe ( spy . mock . calls [ 0 ] [ 2 ] ) ; // onBlur
347349
348350rerender (
349- < Form onSubmit = { onSubmitMock } >
351+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
350352{ ( ) => (
351353< form >
352354< MyField name = "dog" parse = { ( x ) => x } />
@@ -370,13 +372,14 @@ describe("useField", () => {
370372const { input} = useField ( name , {
371373subscription :{ value :true } ,
372374 format,
375+ defaultValue :"" ,
373376} ) ;
374377const { onChange, onFocus, onBlur} = input ;
375378spy ( onChange , onFocus , onBlur ) ;
376- return < input { ...input } /> ;
379+ return < input { ...input } value = { input . value || "" } /> ;
377380} ;
378381const { rerender} = render (
379- < Form onSubmit = { onSubmitMock } >
382+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
380383{ ( ) => (
381384< form >
382385< MyField name = "myField" />
@@ -391,7 +394,7 @@ describe("useField", () => {
391394expect ( spy . mock . calls [ 1 ] [ 2 ] ) . toBe ( spy . mock . calls [ 0 ] [ 2 ] ) ; // onBlur
392395
393396rerender (
394- < Form onSubmit = { onSubmitMock } >
397+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
395398{ ( ) => (
396399< form >
397400< MyField name = "dog" format = { ( x ) => x } />
@@ -415,13 +418,14 @@ describe("useField", () => {
415418const { input} = useField ( name , {
416419subscription :{ value :true } ,
417420 component,
421+ defaultValue :"" ,
418422} ) ;
419423const { onChange, onFocus, onBlur} = input ;
420424spy ( onChange , onFocus , onBlur ) ;
421- return < input { ...input } /> ;
425+ return < input { ...input } value = { input . value || "" } /> ;
422426} ;
423427const { rerender} = render (
424- < Form onSubmit = { onSubmitMock } >
428+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
425429{ ( ) => (
426430< form >
427431< MyField name = "myField" />
@@ -436,7 +440,7 @@ describe("useField", () => {
436440expect ( spy . mock . calls [ 1 ] [ 2 ] ) . toBe ( spy . mock . calls [ 0 ] [ 2 ] ) ; // onBlur
437441
438442rerender (
439- < Form onSubmit = { onSubmitMock } >
443+ < Form onSubmit = { onSubmitMock } initialValues = { { myField : "" , dog : "" } } >
440444{ ( ) => (
441445< form >
442446< MyField name = "dog" component = "select" />