Jishun / react-validated-input

Instance based validated input component for react
MIT License
12 stars 1 forks source link

Warning: Unknown props #4

Closed msimonc closed 8 years ago

msimonc commented 8 years ago

Now getting:

warning.js:44 Warning: Unknown props validate, rules on tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop in input in span in div in ValidatedInput (created by _class) in div (created by _class) in div (created by _class) in div (created by _class) in _class (created by RouterContext)

Jishun commented 8 years ago

Hmm Mark

Are you able to get me a code snippet?

I'll try it tomorrow morning

Thanks! On Tue, Jul 26, 2016 at 9:46 PM, Mark Simon notifications@github.com<mailto:notifications@github.com> wrote:

Now getting:

warning.js:44 Warning: Unknown props validate, rules on tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop in input in span in div in ValidatedInput (created by _class) in div (created by _class) in div (created by _class) in div (created by _class) in _class (created by RouterContext)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Jishun/react-validated-input/issues/4, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3Ngnemz7gqPPBuYkrFTzaatZJaMmlZks5qZuKkgaJpZM4JV1LX.

msimonc commented 8 years ago

Nothing special: (it might be my ES6 build environment again..) Thx!!

import Input, * as inputHelper from 'react-validated-input' ... <Input type="text" validate={this.state.validation} instance={this.state.valiData} placeholder="Email" propertyKey="email" rules={{presence: true, length: {minimum: 2}}}>

                    <Input type="password" validate={this.state.validation} instance={this.state.valiData}
                           placeholder="Password"
                           propertyKey="password"
                           rules={{presence: true, length: {minimum: 2}}}></Input>

                    <Button bsStyle='success' onClick={this.doValidate}>Login</Button>

... doValidate() { inputHelper.validate(this, [this.state.valiData]).then(() => { // console.log('no errors '); this.handleValidSubmit(); }, (errorMessages) => { console.log('errorMessages ', errorMessages); Util.showAlert('invalid'); } ).catch(Util.catchError); }

Jishun commented 8 years ago

updated and published version 0.0.1 the issue was seen because react version 15 added more validations. removed the redundant props

msimonc commented 8 years ago

awesome; fixed!