Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element ref was specified as a string (input) but no owner was set. #626

Closed
jerrypy opened this issue Oct 25, 2017 · 2 comments
Closed

Element ref was specified as a string (input) but no owner was set. #626

jerrypy opened this issue Oct 25, 2017 · 2 comments

Comments

@jerrypy
Copy link

jerrypy commented Oct 25, 2017

复现代码:

<Form model={this.state.form} labelWidth="80" onSubmit={this.onSubmit.bind(this)}>
                <Form.Item label="用户名">
                    <Input value={this.state.form.username} onChange={this.onChange.bind(this, 'username')}></Input>
                </Form.Item>
                <Form.Item label="密码">
                    <Input value={this.state.form.password} type="password" onChange={this.onChange.bind(this, 'username')}></Input>
                </Form.Item>
                <Form.Item>
                    <Button type="primary" nativeType="submit">登录</Button>
                </Form.Item>
            </Form>

react-16.0.0版本,使用表单Input的时候会报错:

Uncaught Error: Element ref was specified as a string (input) but no owner was set. You may have multiple copies of React loaded.

参考:JedWatson/react-select#2025 JedWatson/react-select#606

@e1emeb0t
Copy link
Contributor

我们正在兼容react@16, 即将发布的1.4.0版本将修复这个问题, #621

@e1emeb0t
Copy link
Contributor

e1emeb0t commented Nov 1, 2017

请升级到[email protected]试试看, 暂时先关闭这个issue, 有问题随时可以重新打开.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants