Giter VIP home page Giter VIP logo

Comments (9)

dargonwanglong avatar dargonwanglong commented on May 20, 2024

I also encountered this bug.

from redux-form.

cpoftea avatar cpoftea commented on May 20, 2024

Confirming bug. Validation errors are kept between initialValues changes with enableReinitialize option

from redux-form.

Sojborg avatar Sojborg commented on May 20, 2024

I get this to. Anyone who have an workaround?

from redux-form.

cpoftea avatar cpoftea commented on May 20, 2024

Anyone who have an workaround?

@Sojborg Only with patching a single line of code with patch-package for v8.3.10. But use it at your own risk.

--- a/node_modules/redux-form/es/createReduxForm.js
+++ b/node_modules/redux-form/es/createReduxForm.js
@@ -138,7 +138,7 @@ export default function createReduxForm(structure) {
                   updateUnregisteredFields: nextProps.updateUnregisteredFields
                 });
 
-                return true;
+                return false;
               }
             } else if (_this.props.initialValues && (!_this.props.initialized || enableReinitialize)) {
               _this.props.initialize(_this.props.initialValues, _this.props.keepDirtyOnReinitialize, {

from redux-form.

Sojborg avatar Sojborg commented on May 20, 2024

Thanks @cpof-tea! Did you try to make a PR with this change?

from redux-form.

cpoftea avatar cpoftea commented on May 20, 2024

@Sojborg Actually, I don't have time to check if the original behavior is intended or a bug. Also, I can't say if this patch can break something or not

from redux-form.

pnogier avatar pnogier commented on May 20, 2024

Anyone who have an workaround?

@Sojborg Only with patching a single line of code with patch-package for v8.3.10. But use it at your own risk.

--- a/node_modules/redux-form/es/createReduxForm.js
+++ b/node_modules/redux-form/es/createReduxForm.js
@@ -138,7 +138,7 @@ export default function createReduxForm(structure) {
                   updateUnregisteredFields: nextProps.updateUnregisteredFields
                 });
 
-                return true;
+                return false;
               }
             } else if (_this.props.initialValues && (!_this.props.initialized || enableReinitialize)) {
               _this.props.initialize(_this.props.initialValues, _this.props.keepDirtyOnReinitialize, {

Hi, does anyone encountered any issue using this patch ?

from redux-form.

Sojborg avatar Sojborg commented on May 20, 2024

@pnogier I'm using it and it works in my project and I'm using it in a larger company app with multiple forms with many form elements.

from redux-form.

cpoftea avatar cpoftea commented on May 20, 2024

Thanks @cpof-tea! Did you try to make a PR with this change?

@Sojborg I will open a PR in a few days then

from redux-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.