Closed dmitrif closed 8 years ago
Also tried using createForms
instead, still failing but with a different error:
get-field-from-state.js:39 Uncaught TypeError: Cannot read property 'model' of undefined(…)
I'm pretty sure the check I added in 7efde9f will fix the issue, can you check when the next release goes out?
Thanks, David!
I see the tag for 1.1.0 but when trying to install from NPM it's saying that version doesn't exist.
Hmm, try again?
I think this particular issue is fixed. but I think I realized why this doesn't work for us, is this library compat with redux-immutablejs?
Cheers.
Paging @erin-doyle - she would know the answer to that 😄 I believe it is supposed to work with redux-immutablejs
.
Thank you!
It ends up tripping up on lines such as:
Line 19 in get-field-from-state.js
const formPath = toPath(form.$form.model);
Since I believe form itself is an immutable object in this case. Along with some other spots.
If you'd like to help out with PRs, I'd gladly get them merged in ASAP. The solution to fixing this is two-fold, so for example:
In get-field-from-state.js
:
-const formPath = toPath(form.$form.model);
+const formPath = toPath(s.get(form, ['$form', 'model']));
And then in src/immutable.js
:
function immutableGetFieldFromState(state, modelString) {
- return getField(state, modelString, { getForm: immutableGetForm });
+ return getField(state, modelString, { getForm: immutableGetForm, get: immutableGetFromState });
}
Should be simple fixes, and since you can recreate the errors, you (or someone who uses Immutable.JS) would be best to diagnose them. 🙏
Personally, I do not use Immutable.JS (I use icepick.js so that I can work with standard JS types).
@davidkpiano Thanks :) Working on it!
Hi! It's me again. I changed include to use
import { combineForms } from 'react-redux-form/lib/immutable';
however, an error appears:The reducer is set up as such:
And the form is set up as such:
Please advise. Thank you!