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

Cannot get ref with new withUtilsDateTimePickerWrapper #265

Closed
wieseljonas opened this issue Mar 8, 2018 · 1 comment
Closed

Cannot get ref with new withUtilsDateTimePickerWrapper #265

wieseljonas opened this issue Mar 8, 2018 · 1 comment

Comments

@wieseljonas
Copy link

Environment

Tech Version
material-ui-pickers ^v1.0.0-rc.2
material-ui ^1.0.0-beta.34
React ^16.2.0
Browser Chrome
Platform

Steps to reproduce

              <DateTimePicker
                label="Due date"
                id="datetime-picker"
                autoOk
                innerRef={node => {
                  this.dateTimePicker = node;
                }}
                onChange={this.handleDateTimePickerChange}
                margin="normal"
                fullWidth
                returnMoment={false}
              />

Expected behavior

Should be able to access picker ref to do things like this.dateTimePicker.wrapper.open();

Actual behavior

Get this error

Warning: Stateless function components cannot be given refs. Attempts to access this ref will fail.
@dmtrKovalenko
Copy link
Member

Fixed in rc-3

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