I am having an issue with framer-motion AnimatePresence component. I am trying to start the animation after the component is visible within the viewport, to achieve this, I used react-intersection-observer. It works as intended for the starting animation, but the exit animation breaks and I am not sure what is causing the problem. I created a sandbox that reproduces this behavior at https://codesandbox.io/s/holy-dream-rb5gu?file=/src/index.js
Related Questions in REACTJS
- ussd reader in Recket Native module
- Teams tab application returns SSO error in mobile Outlook
- Github Pages Deployment deploys a blank page
- Is there any way to glow this bulb image like a real light bulb
- Optimize LCP ReactJs
- Page in React only renders elements after refreshing
- Unable to Post Form Data to MongoDB because of picturepath
- MERN Stack App - User Avatar Upload - 500 Error After Deployment on Render
- Hooks are not supported inside an async component error in nextjs project using useQuery
- How to change the Font Weight of a SelectValue component in React when a SelectItem is selected?
- On the server side, it returns undefined but on the client side, logs the values no problem
- Multilevel dropdown with checkboxes in Select component
- TypeScript Error only on big type only when assigned to a variable
- Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
- Data is not filtering in props. Showing passdata.map is not a function
Related Questions in FRAMER-MOTION
- Leave animation doesnt work in React project with Framer Motion
- framer motion scroll animation only when scroll down not while scroll up
- How can i get smooth framer motion animations on my navbar?
- How to animate an item when it appears :hidden
- Snap scroll to div in horizontal scroll via lenis smooth scroll and framer motion
- TS2786 in every component and file
- How to use stagger from framer-motion
- How do I use a loading page with a template page transition with framer-motion and Next 14?
- framer-motion `useInView` does not work when rendered conditonally
- text disappears if you unhover mid-animation
- framer-motion AnimatePresence and LayoutGroup for pagination animation
- Using Framer Motion in React class components (non-functional)
- svg animation using framer motion
- How to dynamically change the value of the text based on the document.title
- Targeting an element (or parent) using Framer Motion
Related Questions in REACT-INTERSECTION-OBSERVER
- React-Intersection-Observer running into infintite loop giving "Maximum update depth exceeded." in nextjs 14 app directory
- Issues with SVG Path Animation using Framer Motion in React(Next.Js)
- How to prevent components from constantly remounting when lazy-loading with react-intersection-observer?
- How to render a component only when they are visible ( react-intersection-observer )
- hide text before animaiton get triggered
- How to set root in react-intersection-observer
- Type 'MutableRefObject<null>' is missing the following properties from type 'Element'
- Trying to implement react-intersection-observer inside react-grid-layout with no luck
- How to restrict the first fetch call to happen only when the view is visible in the viewport
- React & Typescript Issue: trigger elements with InsertionObserver using props and manage them in other component
- React Three Fiber, Drei & Intersection Observer: How to change Canvas Model Element Based on The InView Component
- Smooth scroll (locomotive scroll) and scroll triggered animation (framer motion + react-intersection-observer) bug
- Stagger divswhen they are in view using react-intersection-observer and framer-motion
- Why does a react component, tested with React Testing Library has issue with react-intersection-observer?
- react-intersection-observer only works with the last elements
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
It looks like using the imperative AnimationControls API is overriding the other declarative animation settings for the element (like
exit).Changing that
animateprop to just accept a variant instead of an animation control seems to work:Code Sandbox example
I added a state for the current variant. Starts as
hiddenand updates tovisiblewheninViewchanges:Then use that variant state to update the animation prop on the div: