I'm encountering a peculiar issue with the positioning of Material-UI (MUI) Snackbar components (and other statically positioned components) when they are wrapped in a motion.div from the framer-motion library. It seems that the animation applied to the motion.div is affecting the positioning of the Snackbar, causing it to behave unexpectedly.
This is related to Why does applying a CSS-Filter on the parent break the child positioning?
Example: https://codesandbox.io/s/boring-silence-5c4gxy?file=/src/App.js:727-836
Note that all direct and indirect children of About
will have the same issue making wrapping a page in a motion.div
extremely difficult.
Removing motion.div in About
brings the Snackbars to their correct position.
const About = () => (
<Container maxWidth="xl">
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
</ul>
</nav>
<h1>About Page</h1>
<SimpleSnackbar />
</Container>
);