-
I've been seeing an issue in mobx-react with bootstrap-4 and I'm getting some unexpected results that is driving me crazy. I've boiled it down to the simple example below.
But if the
Any idea what might be going on here? Full Source is below.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, it's not related to Mobx. If you don't provide "If this attribute isn't provided, the data will be sent to the URL of the page containing the form — the current page." You can fix it by providing
Here is a working example: https://codesandbox.io/s/adoring-sky-xrwbpd?file=/index.js |
Beta Was this translation helpful? Give feedback.
Hi, it's not related to Mobx. If you don't provide
action
attribute on a form, it sends the data to current URL thus reloading page: https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data#the_action_attribute"If this attribute isn't provided, the data will be sent to the URL of the page containing the form — the current page."
You can fix it by providing
onSubmit
attribute to prevent form submitting:Here is a working example: https://codesandbox.io/s/adoring-sky-xrwbpd?file=/index.js