Closed rileylnapier closed 7 years ago
Thanks for the report, will take a look
Updated the deps, please check if everything is OK for you
👍 looks good. thanks for quick turnaround
i seem to be getting an error and im not sure if its related to upgrading ramda.
when i destroy a form. i get "REMOVE_FORM" and "SUBMIT_STOP" events. I notice after this, there remains a field on the form called "submitting".
when I use the selectors from redux-forms, we use the following code:
function errorSelector(name, state) {
var form = (0, _path2.default)(['reduxForms', name], state);
console.log(name, form);
if (!form) {
return EMPTY;
}
return memError(form.fields);
}
the check on !form doesn't seem to be good enough as my form === { submitting: false }.
if I change the code
function errorSelector(name, state) {
var form = (0, _path2.default)(['reduxForms', name], state);
console.log(name, form);
if (!form || !form.fields) {
return EMPTY;
}
return memError(form.fields);
}
by adding !form.fields ~ then it doesn't error out, but this doesn't seem like a good patch.
it happens with both errorSelector and isValid. unclear if any other selectors are affected. I also found this issue: https://github.com/ramda/ramda/issues/2219
that's weird, never run into that. I will check it out, thanks for reporting
does SUBMIT_STOP
get fired automatically, or do you return a Promise in the onSubmit
callback which causes a delayed action trigger? this behavior would make sense in that case. it is an edge case I haven't thought of, I will have to adjust stuff to cover such cases
it doesn't return a promise, it doesn't return anything... its tied directly to a thunk action and uses redux-promise-middleware.
looks something like this:
export const loginUser = ({
email,
password,
timeout = DEFAULT_TIMEOUT
}) => (dispatch) => {
dispatch({
type: LOGIN_USER,
payload:
api_loginEmail({
email,
password
})
})
}
i wrote a temporary fix formyself
import {
errorSelector,
isValid
} from "redux-forms/selectors";
export const formErrorSelector = (formName, { reduxForms }) => {
const thisForm = reduxForms[formName];
if (!thisForm || !thisForm.fields) {
return {};
}
return errorSelector(formName, { reduxForms });
}
export const formIsValid = (formName, { reduxForms }) => {
const thisForm = reduxForms[formName];
if (!thisForm || !thisForm.fields) {
return {};
}
return isValid(formName, { reduxForms });
}
@rileylnapier I updated redux-forms-react
to v0.12.0. It uses redux-forms
v1.0.0-1 (pre-release). It contains a fix for this issue.
Note that these selectors were renamed:
valueSelector
-> getValues
errorSelector
-> getErrors
I recommend you to update redux-forms-react
to v1.0.0-2 in the near future, as it will be the stable and supported version soon.
However, I am going to keep releasing patches for v0.12 for some time if people demand so. 👍
Let me know if your issue persists!
sigh.... after upgrading, and going through upgrade guide... im finding bugs :(
trying to create a field like this
turns into props like this
which i guess its stripping off the props i need to render a checkbox. really any props passed to a component that is decorated by @field seems to get stripped. including placeholder
I see, thanks for the report, I will fix this right away
on positive note... im not seeing the original error!!!
Ok redux-forms-react
1.0.0-5 should be fixed. Thanks for the reports!
I added regression tests to cover these cases.
looks good! thanks for quick turnaround. if i see anything else, ill create new issue
im seeing rambda in my entry bundle under redux-forms and in my vendor bundle from min-chunks > 2 (redux-forms-react). you're library is the only one using ramda in my package. if i update redux-forms to use ramda "0.24.1" then i don't get this issue.
i created this https://github.com/oreqizer/redux-forms/compare/master...rileylnapier:patch-1