Multiple transition animations associated with the same array
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 29.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
🚀 Feature Proposal?
When I add/remove an item from an array, I need to do transition animations on multiple DOM elements. Imagine children or elements on the same level. Right now this is not possible yet I guess.
const transitions = useTransition(rows, {
animation1: {
from: { opacity: 0 },
enter: { opacity: 1 },
leave: { opacity: 0 }
},
animation2: {
from: { transform: "translateX(50px)" },
enter: { transform: "translateX(0)" },
leave: { transform: "translateX(50px)" }
}
});
<ul>
{transition((props, row) => (
<animated.li style={props.animation1}>
<animated.div style={props.animation2}>...</animated.div>
</animated.li>
))}
</ul>
Example
I've prepared a Codesandbox, but of course I couldn't get it working:
Codesandbox
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the useTransition usage shown in the issue and inspect the linked Codesandbox, especially src/components/Rows.jsx. Determine how multiple DOM elements on the same array item should receive transition styles and whether the current API supports that shape. Done means the proposed example works for both animation1 and animation2, with behavior covered by an appropriate test or example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100