-
Notifications
You must be signed in to change notification settings - Fork 934
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
@material-ui/core 4.0.0-beta.1 Warning: Function components cannot be given refs. #595
Comments
Having this issue aswell. |
This library does not yet fully support versions of the material-ui library that are that high. The first step would be to take it up to the high 3's, which I've done some work on locally. |
I've recently had to add
The components that trigger the warning are the |
Are there any plans to support v4 now that it's officially released? Maybe a set of milestones for an mui-datatables v3 release with associated issues would be a good start, and then people (like myself) could start picking them up if you're looking for help, @gabrielliwerant. |
@pfarnach Yes, support for v4 is part of the plan. That's not a bad idea about milestones and/or issues around upgrade necessities. Trying to review some PRs and fix some bugs at the moment, but when I get some time, I can start work on an upgrade roadmap. |
A lot of v4 is already supported and just works OOTB. There are instances like here: mui-datatables/src/components/TableToolbar.js Lines 214 to 223 in dc45413
...where gregnb/react-to-print uses a cloned and ref injected component on trigger (MatthewHerbst/react-to-print#131), so things like that are the only places where I'm seeing issues.
|
I Having this issue aswell.
|
Yeah, still an issue with |
FYI, the upgrade roadmap is behind this issue in terms of priority: #679. When I get a good chunk of time, I can begin making progress on it, but for the near and mid future, I recommend not using the latest material ui versions. |
Just wrap the Tooltip in a div.
|
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
|
@YoungCC2 Can you give the versions of react, material, and this library that cause you to experience that error? |
`<Form.Item label="上传logo"> {getFieldDecorator('dragger', { rules: [{ required: true, message: 'Please select your country!' }], })( <Dragger {...props}>
点击上传logo
|
@YoungCC2 Thanks, but I still need your '@material-ui/core' and 'mui-datatables' versions. |
@gabrielliwerant i do`t install @material-ui/core and mui-datatables |
@YoungCC2, I'm not sure I understand. This library is |
i rewrite this component. the question was reslove .........
…------------------ 原始邮件 ------------------
发件人: "Gabriel Liwerant"<notifications@github.com>;
发送时间: 2019年9月4日(星期三) 凌晨3:38
收件人: "gregnb/mui-datatables"<mui-datatables@noreply.github.com>;
抄送: "卯卯"<743472220@qq.com>; "Mention"<mention@noreply.github.com>;
主题: Re: [gregnb/mui-datatables] @material-ui/core 4.0.0-beta.1 Warning: Function components cannot be given refs. (#595)
@YoungCC2, I'm not sure I understand. This library is mui-datatables, so you must have this installed at all, unless you are posting on the wrong library!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
What if its not an IconButton and just an Icon. More specifically the icon is dynamically loaded as a functional method so I was pointed in the direction of creating a forward ref component but still nothing would pop up on hover. |
Wrapping the child component with a Instead of
do this
|
When using
@material-ui/core
4.0.0-beta.1
&mui-datatables
2.0.0
I get the following warning:I suspect it has something to do with the fact that the MUI team has changed their components to be functional and use Hooks.
The text was updated successfully, but these errors were encountered: