I am using the example of controlled Accordions from material ui's docs (https://material-ui.com/components/accordion/#ControlledAccordions.js) but after adding onChange and extended props to the Accordion component, it's transitions are gone. Here's a sandbox: https://codesandbox.io/s/lueeq The transitions are fine after removing onChange and extended props from Accordion in Acc.js (line 77, 78)
Asked
Active
Viewed 1,616 times
1
-
1Same issue as here: https://stackoverflow.com/questions/60210288/popover-menu-renders-in-different-place-than-the-anchor-element/60211641#60211641. You're defining MuiAccordion nested within the History component. Every time History is re-rendered, MuiAccordion will be re-mounted. You need to move MuiAccordion to the top-level. – Ryan Cogswell Aug 15 '20 at 19:46
-
@RyanCogswell makes sense! Thanks, will do that! – YashKandalkar Aug 16 '20 at 06:22
-
@YashKandalkar did you suss this out? thx – sambomartin May 10 '21 at 00:45
-
@sambomartin yes, just don't define any components inside another component, define them at the top level as Ryan said. That worked for me. – YashKandalkar May 20 '21 at 14:20