You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constLinkWithRef=React.forwardRef((props,ref)=>(<CSVLinkref={(c)=>{console.log("csvLink",c);console.log("ref",ref);ref(c?.link);}}{...props}/>));<Buttoncomponent={LinkWithRef}ref={(ref)=>console.log(ref)}data={csvData}>
Download me
</Button>
After switching from
material-ui@4
tomui@5
CSVLink
stopped working for me because it is not forwarding ref to the original element.Example:
Codesandbox: https://codesandbox.io/s/mui-5-and-react-csv-we3q8f
Error:
What do you think about about rewriting
CSVLink
component as a functional component with usage ofReact.forwardRef
? (I can submit a pr)The text was updated successfully, but these errors were encountered: