react-router-form icon indicating copy to clipboard operation
react-router-form copied to clipboard

submit to self doesn't work

Open julian-rare opened this issue 9 years ago • 5 comments

When the form submits to itself (to the same page), the handler is not triggered

julian-rare avatar Oct 18 '16 23:10 julian-rare

To clarify, the form submits, but handleEnter is not called again.

citelao avatar Feb 01 '17 19:02 citelao

I assume you'd need to use the onChange hook instead if you know a form will be submitting to the same URL - this didn't exist when react-router-form was initially created.

insin avatar Feb 01 '17 20:02 insin

@insin Does that work isomorphically (e.g. hard reload)?

citelao avatar Feb 02 '17 18:02 citelao

According to the docs, you'd probably want both onChange and onEnter in that case - onEnter for the server and onChange for the browser.

onChange(prevState, nextState, replace, callback?)

Called on routes when the location changes, but the route itself neither enters or leaves.

insin avatar Feb 02 '17 18:02 insin

This is a "problem" within React Router, then, not react-router-form, correct?

citelao avatar Feb 02 '17 18:02 citelao