Skip to content

ExpansionPanel doesn't support ref in typescript description #14295

@indapublic

Description

@indapublic

Ref callback is successfully working for ExpansionPanel but ExpansionPanelProps not containing ref method declaration in https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/ExpansionPanel/ExpansionPanel.d.ts

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

No errors.

Current Behavior 😯

I see error:

Type '{ children: Element; expanded: false; ref: ((ref?: any) => void) | undefined; }' is not assignable to type 'IntrinsicAttributes & ExpansionPanelProps & { children?: ReactNode; }'.
Property 'ref' does not exist on type 'IntrinsicAttributes & ExpansionPanelProps & { children?: ReactNode; }'.ts(2322)

Steps to Reproduce 🕹

Put code

<ExpansionPanel expanded={false} ref={ref}>
...
</ExpansionPanel>

and run linter.

Tech Version
Material-UI v3.1.0
React 16.5.2
Browser
TypeScript 2.8.3
etc.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions