Purpose and Basics
In a beginner React project, what is Framer Motion primarily used for when building a user interface?
- Creating declarative animations and interactive gestures in React components
- Handling global state across Redux stores
- Building server-rendered HTML on the backend
- Compiling TypeScript to JavaScript
- Querying a NoSQL database
Motion Component Choice
If you want a block-level container to be animatable, which component would you render to replace a regular div?
- motion.div
- motion.span
- AnimatedDiv
- Trans.Div
- motionView
Start vs End Props
When animating a card from off-screen to visible, which pair of props defines the starting and ending animation states?
- initial and animate
- from and to
- enter and leave
- start and finish
- intial and animate
Exit Animations on Unmount
To animate a list item as it leaves the React tree (for example, when it is removed from a list), what do you need to use along with an exit prop on the item?
- Wrap the conditionally rendered component with AnimatePresence and define an exit prop on it
- Use Suspense with a fallback that plays the exit animation
- Call useEffect to start a CSS transition on unmount
- Add a leaveStyle prop to the component
- Enable autoExit on the parent container
Spring vs Tween
If you want a box to bounce naturally into place, which transition choice is most appropriate for that effect?
- Use a spring transition (type: 'spring') to create a bouncy movement
- Use a tween transition with linear easing for extra bounce
- Use type: 'keyframe' to simulate physics
- Set easing: 'bezier(0,0,0,0)' to enable physics
- Apply type: 'sprint' for fast spring animation
Drag Interactions
If a card should be draggable only along the horizontal axis, which prop would you add to the component?
- drag='x'
- draggable
- pan
- dragEnabled
- dragAxis='horizontal'
Variants for Reuse
When multiple buttons need to share named animation states like 'hidden' and 'visible', what feature should you use to define and reuse those states?
- Define variants on the parent and reference them on children via the variants prop
- Use a presets prop that broadcasts states to all children
- Provide themes to switch between animation states
- Use a varients prop on each child to avoid duplication
- Attach a states prop with named animations
Hover Gestures
If a button should slightly scale up while the user hovers over it, which prop would you add to the button?
- whileHover={{ scale: 1.1 }}
- onHover={{ scale: 1.1 }}
- hover={{ scale: 1.1 }}
- whileTap={{ scale: 1.1 }}
- whenHover={{ scale: 1.1 }}
Layout Animations
When grid items change size and position after a filter is applied, which prop enables smooth automatic layout transitions for those changes?
- Add the layout prop to the items so position and size changes animate
- Add autoLayout to each item to animate rearrangements
- Set layoutMode='smart' on the container to handle reflow
- Enable flexAnimate on the parent grid to animate flex updates
- Set resizeAnimation on each child to track bounds changes
Keyframes Syntax
To move a box from x = 0 to 100 and back to 0 using keyframes in a single animation, which animate syntax is correct?
- animate={{ x: [0, 100, 0] }}
- animate={{ x: '0-u003E100-u003E0' }}
- keyframes={{ x: [0, 100, 0] }}
- useKeyframes([0, 100, 0])
- frames={{ x: [0, 100, 0] }}