Closed brandonmp closed 7 years ago
Hi @brandonmp
which version of mobx, mobx-react and mobx-react-form are you using?
What "keystrokes in the input field don't register" mean? The input value changes into the input and the form state is not updated OR the input values are not updated and they remain fixed into the input?
The observer
method is not part of mobx
but you should import mobx-react
instead:
import { observer } from 'mobx-react';
You can try to place makeFields()
function and the form initialization outside the react render()
method.
As you are using arrow function for makeFields()
, you don't need to use return
, just do:
const makeFields = currentUser => ({
email: {
label: 'Email',
placeholder: 'Insert Email',
value: currentUser.emailAddress,
rules: 'required|email|string|between:5,25',
},
password: {
label: 'Password',
placeholder: 'Insert Password',
rules: 'required|string|between:5,25',
},
});
If you didn't fixed it yet, then you should review you app structure and maybe the babel plugins and presets you are using.
Anyway I suggest you to use react stateless functional components as much as you can.
I close this issue for inactivity.
Feel free to reopen this if you need more help.
I must be missing something super obvious b/c this seems like a really basic use case, but I can't figure out how to set initial values w/
props
and then handle user inputs normally (ie, keystrokes aren't registered).I've adapted your example from the tutorial:
As i mentioned, the initial value populates fine, but keystrokes in the input field don't register.
Am I missing something simple here?
ETA: I've also tried passing in
state
asvalue
, but no dice.