react-motion
Advanced tools
Comparing version 0.4.7 to 0.4.8
@@ -37,13 +37,19 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var msPerFrame = 1000 / 60; | ||
var Motion = _react2['default'].createClass({ | ||
displayName: 'Motion', | ||
var Motion = _createReactClass2['default']({ | ||
propTypes: { | ||
// TOOD: warn against putting a config in here | ||
defaultStyle: _react.PropTypes.objectOf(_react.PropTypes.number), | ||
style: _react.PropTypes.objectOf(_react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.object])).isRequired, | ||
children: _react.PropTypes.func.isRequired, | ||
onRest: _react.PropTypes.func | ||
defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number), | ||
style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired, | ||
children: _propTypes2['default'].func.isRequired, | ||
onRest: _propTypes2['default'].func | ||
}, | ||
@@ -50,0 +56,0 @@ |
@@ -27,2 +27,6 @@ 'use strict'; | ||
var _stripStyle = require('./stripStyle'); | ||
exports.stripStyle = _interopRequire(_stripStyle); | ||
// deprecated, dummy warning function | ||
@@ -29,0 +33,0 @@ |
@@ -37,2 +37,10 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var msPerFrame = 1000 / 60; | ||
@@ -49,10 +57,8 @@ | ||
var StaggeredMotion = _react2['default'].createClass({ | ||
displayName: 'StaggeredMotion', | ||
var StaggeredMotion = _createReactClass2['default']({ | ||
propTypes: { | ||
// TOOD: warn against putting a config in here | ||
defaultStyles: _react.PropTypes.arrayOf(_react.PropTypes.objectOf(_react.PropTypes.number)), | ||
styles: _react.PropTypes.func.isRequired, | ||
children: _react.PropTypes.func.isRequired | ||
defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)), | ||
styles: _propTypes2['default'].func.isRequired, | ||
children: _propTypes2['default'].func.isRequired | ||
}, | ||
@@ -59,0 +65,0 @@ |
@@ -41,2 +41,10 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var msPerFrame = 1000 / 60; | ||
@@ -163,20 +171,18 @@ | ||
var TransitionMotion = _react2['default'].createClass({ | ||
displayName: 'TransitionMotion', | ||
var TransitionMotion = _createReactClass2['default']({ | ||
propTypes: { | ||
defaultStyles: _react.PropTypes.arrayOf(_react.PropTypes.shape({ | ||
key: _react.PropTypes.string.isRequired, | ||
data: _react.PropTypes.any, | ||
style: _react.PropTypes.objectOf(_react.PropTypes.number).isRequired | ||
defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({ | ||
key: _propTypes2['default'].string.isRequired, | ||
data: _propTypes2['default'].any, | ||
style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired | ||
})), | ||
styles: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.arrayOf(_react.PropTypes.shape({ | ||
key: _react.PropTypes.string.isRequired, | ||
data: _react.PropTypes.any, | ||
style: _react.PropTypes.objectOf(_react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.object])).isRequired | ||
styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({ | ||
key: _propTypes2['default'].string.isRequired, | ||
data: _propTypes2['default'].any, | ||
style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired | ||
}))]).isRequired, | ||
children: _react.PropTypes.func.isRequired, | ||
willEnter: _react.PropTypes.func, | ||
willLeave: _react.PropTypes.func, | ||
didLeave: _react.PropTypes.func | ||
children: _propTypes2['default'].func.isRequired, | ||
willEnter: _propTypes2['default'].func, | ||
willLeave: _propTypes2['default'].func, | ||
didLeave: _propTypes2['default'].func | ||
}, | ||
@@ -238,3 +244,3 @@ | ||
var _mergeAndSync = mergeAndSync( | ||
// Because this is an old-style React.createClass component, Flow doesn't | ||
// Because this is an old-style createReactClass component, Flow doesn't | ||
// understand that the willEnter and willLeave props have default values | ||
@@ -333,5 +339,15 @@ // and will always be present. | ||
} | ||
// TODO: when config is {a: 10} and dest is {a: 10} do we raf once and | ||
// call cb? No, otherwise accidental parent rerender causes cb trigger | ||
this.animationID = _raf2['default'](function (timestamp) { | ||
// https://github.com/chenglou/react-motion/pull/420 | ||
// > if execution passes the conditional if (this.unmounting), then | ||
// executes async defaultRaf and after that component unmounts and after | ||
// that the callback of defaultRaf is called, then setState will be called | ||
// on unmounted component. | ||
if (_this.unmounting) { | ||
return; | ||
} | ||
var propStyles = _this.props.styles; | ||
@@ -338,0 +354,0 @@ var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles; |
{ | ||
"name": "react-motion", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "A spring that solves your animation problems.", | ||
@@ -76,5 +76,7 @@ "main": "lib/react-motion.js", | ||
"dependencies": { | ||
"create-react-class": "^15.5.2", | ||
"performance-now": "^0.2.0", | ||
"prop-types": "^15.5.8", | ||
"raf": "^3.1.0" | ||
} | ||
} |
@@ -86,3 +86,3 @@ # React-Motion | ||
P.S. using TypeScript? [Here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-motion/react-motion.d.ts) are the React-motion TypeScript definitions! | ||
P.S. using TypeScript? [Here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-motion/index.d.ts) are the React-motion TypeScript definitions! | ||
@@ -198,3 +198,5 @@ --- | ||
```jsx | ||
const Demo = React.createClass({ | ||
import createReactClass from 'create-react-class'; | ||
const Demo = createReactClass({ | ||
getInitialState() { | ||
@@ -201,0 +203,0 @@ return { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
434230
4028
311
5
33
1
+ Addedcreate-react-class@^15.5.2
+ Addedprop-types@^15.5.8
+ Addedcreate-react-class@15.7.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-is@16.13.1(transitive)