Git Product home page Git Product logo

Comments (4)

NewOldMax avatar NewOldMax commented on May 26, 2024 1

It happens when your value was null or undefined before changing.

state = {
    user: {}
};

<TextValidator
    value={user.email}    <------ first time user.email = undefined, so react thinks that is uncontrolled input
/>

And you can do something like this to avoid error

state = {
    user: {
        email: ''  <---- empty string by default
    }
};

<TextValidator
    value={user.email}    <------ works without warning
/>

Or something like value={user.email || ''}

from react-material-ui-form-validator.

NewOldMax avatar NewOldMax commented on May 26, 2024

Hi
As you can see, event already "prevented". If you want to use event for some purposes, I can add it to submit callback

from react-material-ui-form-validator.

darrensw777 avatar darrensw777 commented on May 26, 2024

Hi

Arrghh - I must have skipped over that - thanks for the swift reply, appreciated.

Last question, I also get the following warning:

Warning: TextField is changing an uncontrolled input of type text to be controlled.

Have you seen that? Not on submission, on change in a <TextValidator /> field

from react-material-ui-form-validator.

darrensw777 avatar darrensw777 commented on May 26, 2024

Can't thank you enough, only just started on React...it's good so far but sometimes a bit strange in it's warnings... thanks again, much appreciated

from react-material-ui-form-validator.

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.