chenglou / chenglou/react-motion
Motion onRest and redux
- Dominant language
- JavaScript
- Stars
- 21.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I recently wanted to concatenate two motions. I wanted a container to become transparent do something inside (routing) and then make it visible again.
Without calling nextTick concatenation doesn't work and the component stays not visible.
If it's not the case of changing the code at least a note in the documentation could help.
Here it is my simple change:
```javascript
import React from "react";
import PropTypes from "prop-types";
import nextTick from "browser-next-tick";
import {Motion as ReactMotion} from "react-motion";
const Motion = ({
onRest,
children,
...other
}) => {
return ( {
onRest ? nextTick(() => onRest()) : null;
}}
{...other}>
{children}
)
};
Motion.propTypes = {
children: PropTypes.func.isRequired
};
export default Motion;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the concatenated-motion case described in the issue, where routing occurs after a container becomes transparent. Compare the reported behavior with and without browser-next-tick around onRest. Done means either the motion sequence works without the workaround or the documentation clearly explains the required sequencing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100