[feat]: trail onComplete event
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by tracing the useTrail API and its existing onRest behavior, using the linked CodeSandbox as the behavioral example. Define completion for a trail as the point when all springs from one trail have reached rest, and verify that the new event fires once for that condition.
Written by the indexing model from the issue text.
Description
A clear and concise description of what the feature is
A onComplete (or similar) event that triggers when ALL parts of a trail has completed. This is analogous to the onRest event on a single spring.
Why should this feature be included?
The onRest is a useful event for single springs. It would be great to have a similar event on trails.
Please provide an example for how this would work
onComplete should trigger when all springs from a single trail has reached rest.
I am achieving a similar effect by using the following code today.
const onComplete = () => console.log('trail completed')
const trail = useTrail(baseSquares.length, {
to: {"rotation-x": -Math.PI / 2},
from: {"rotation-x": 0},
onRest: (_, w) => {
if (w.springs["rotation-x"]._priority === offsets.length - 1) onComplete()
},
})
CSB https://codesandbox.io/s/quirky-visvesvaraya-8kbukr?file=/src/App.js
- Dominant language
- TypeScript
- Stars
- 29.3k
- Forks
- 1.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 17
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from pmndrs/react-spring
-
template: bug
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
pmndrs/react-spring#2656 ·
Maintainers usually reply within 1 day
-
area: core kind: request
Difficulty 4/5 3-5 days Newbie friendliness 55/100
pmndrs/react-spring#2542 ·
Maintainers usually reply within 1 day
-
area: typescript kind: request release: major
Difficulty 4/5 3-5 days Newbie friendliness 52/100
pmndrs/react-spring#2541 · 1 comment ·
Maintainers usually reply within 1 day
-
release: major type: RFC
Difficulty 5/5 Over a week Newbie friendliness 35/100
pmndrs/react-spring#2522 · 1 comment ·
Maintainers usually reply within 1 day
-
[bug]: Tab crash with skipAnimation and loopPossibly taken @mrityunjay-pandey claimed this 43 days ago. Openarea: core kind: bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
pmndrs/react-spring#2409 ·
Maintainers usually reply within 1 day
All issues in pmndrs/react-spring
Similar issues
-
bug zoo
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/runntime#151 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
sidebandstudio/clawtrate#728 ·
Maintainers usually reply within 1 day
-
enhancement github_actions help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tranquilo-art/tranquilo-app#254 ·
Maintainers usually reply within 1 day
-
docs good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
DojoCodingLabs/hermit#73 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Tfoucher5/fuzzy-toolkit#44 ·
Maintainers usually reply within 1 day