File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
react-server-dom-webpack/src/__tests__ Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ describe('ReactFlightDOMForm', () => {
354354
355355 // @gate enableFormActions
356356 // @gate enableAsyncActions
357- it ( " useFormState can change the action's target with the `permalink` argument" , async ( ) => {
357+ it ( ' useFormState can change the action URL with the `permalink` argument' , async ( ) => {
358358 const serverAction = serverExports ( function action ( prevState ) {
359359 return { state : prevState . count + 1 } ;
360360 } ) ;
@@ -386,7 +386,7 @@ describe('ReactFlightDOMForm', () => {
386386 const span = container . getElementsByTagName ( 'span' ) [ 0 ] ;
387387 expect ( span . textContent ) . toBe ( 'Count: 1' ) ;
388388
389- expect ( form . target ) . toBe ( '/permalink' ) ;
389+ expect ( form . action ) . toBe ( 'http://localhost /permalink' ) ;
390390 } ) ;
391391
392392 // @gate enableFormActions
@@ -427,6 +427,6 @@ describe('ReactFlightDOMForm', () => {
427427 const span = container . getElementsByTagName ( 'span' ) [ 0 ] ;
428428 expect ( span . textContent ) . toBe ( 'Count: 1' ) ;
429429
430- expect ( form . target ) . toBe ( '/permalink' ) ;
430+ expect ( form . action ) . toBe ( 'http://localhost /permalink' ) ;
431431 } ) ;
432432} ) ;
Original file line number Diff line number Diff line change @@ -575,12 +575,12 @@ function useFormState<S, P>(
575575 dispatch . $$FORM_ACTION = ( prefix : string ) => {
576576 // $FlowIgnore[prop-missing]
577577 const metadata : ReactCustomFormAction = boundAction . $$FORM_ACTION ( prefix ) ;
578- // Override the target URL
578+ // Override the action URL
579579 if ( permalink !== undefined ) {
580580 if ( __DEV__ ) {
581581 checkAttributeStringCoercion ( permalink , 'target' ) ;
582582 }
583- metadata . target = permalink + '' ;
583+ metadata . action = permalink + '' ;
584584 }
585585 return metadata ;
586586 } ;
You can’t perform that action at this time.
0 commit comments