mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.95k stars 32.27k forks source link

[Box] Allow ref on Box #19275

Closed lcswillems closed 4 years ago

lcswillems commented 4 years ago

Summary 💡

This has already been asked here: https://github.com/mui-org/material-ui/issues/17010 but closed because issue didn't contain enough details.

I am using TypeScript and this code:

<Box ref={myRef} />

doesn't work because Material-UI doesn't allow the Box component to receive a ref.

I can't give you a repro because I don't see how I could create a Codesandbox with Material-UI + TypeScript.

oliviertassinari commented 4 years ago

Moving the discussion back to #17010, where developers might have already subscribed to.

oliviertassinari commented 4 years ago

@lcswillems Thanks for increasing the signal/noise ratio on this matter. I have also changed my reply incomplete template to point to the TypeScript version of codesandbox, JavaScript users can use the TypeScript version but the other way around is harder.

lcswillems commented 4 years ago

I will create a repro later today

n8sabes commented 4 years ago

This is a major issue that prevents use of animation libraries such as Greensock/GSAP. ALL GENERATED NODES need the ability to add a ref. Moving over to #17010.