Skip to content

Commit

Permalink
Improve children type
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jul 22, 2024
1 parent 288863b commit 5b67586
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Accordion, { AccordionSlots } from '@mui/material/Accordion';
import Accordion from '@mui/material/Accordion';
import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import Typography from '@mui/material/Typography';
Expand All @@ -18,7 +18,7 @@ export default function AccordionTransition() {
<Accordion
expanded={expanded}
onChange={handleExpansion}
slots={{ transition: Fade as AccordionSlots['transition'] }}
slots={{ transition: Fade }}
slotProps={{ transition: { timeout: 400 } }}
sx={[
expanded
Expand Down
8 changes: 3 additions & 5 deletions packages/mui-material/src/Accordion/Accordion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export interface AccordionSlots {
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @default Collapse
*/
transition?: React.JSXElementConstructor<
TransitionProps & { children?: React.ReactElement<any, any> }
>;
transition?: React.ElementType<TransitionProps & { children: React.ReactElement<any, any> }>;
}

export interface AccordionTransitionSlotPropsOverrides {}
Expand Down Expand Up @@ -80,8 +78,8 @@ export type AccordionTypeMap<
* The component used for the transition.
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
*/
TransitionComponent?: React.JSXElementConstructor<
TransitionProps & { children?: React.ReactElement<any, any> }
TransitionComponent?: React.ElementType<
TransitionProps & { children: React.ReactElement<any, any> }
>;
/**
* Props applied to the transition element.
Expand Down

0 comments on commit 5b67586

Please sign in to comment.