React-motion: Failed propType: Invalid prop `styles` supplied to `TransitionMotion` when upgrading to 0.4.1 from 0.3.1

Created on 26 Jan 2016  路  5Comments  路  Source: chenglou/react-motion

Is the prop name no longer styles?

Additionally, I get this error:

TypeError: destStyles.map is not a function
    at getInitialState (http://localhost:3001/assets/bundles/app.self.js?body=1:38055:63)
    at new Constructor (http://localhost:3001/assets/bundles/app.self.js?body=1:43848:54)
    at ReactCompositeComponentMixin.mountComponent (http://localhost:3001/assets/bundles/app.self.js?body=1:44286:18)
    at wrapper [as mountComponent] (http://localhost:3001/assets/bundles/app.self.js?body=1:51193:21)
    at Object.ReactReconciler.mountComponent (http://localhost:3001/assets/bundles/app.self.js?body=1:51823:35)
    at ReactCompositeComponentMixin.mountComponent (http://localhost:3001/assets/bundles/app.self.js?body=1:44363:34)
    at wrapper [as mountComponent] (http://localhost:3001/assets/bundles/app.self.js?body=1:51193:21)
    at Object.ReactReconciler.mountComponent (http://localhost:3001/assets/bundles/app.self.js?body=1:51823:35)
    at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (http://localhost:3001/assets/bundles/app.self.js?body=1:50520:44)
    at ReactDOMComponent.Mixin._createContentMarkup (http://localhost:3001/assets/bundles/app.self.js?body=1:45605:32)

Most helpful comment

For google: the key should be a string, I didn't notice my that my key was a number.

All 5 comments

Changing the prop name to style makes react-motion complain that I'm not providing anything to the styles prop

styles is now an array of the format:

[
  {key: 'key1', style: {x: spring(10)}},
  {key: 'key3', style: {x: spring(10)}},
]

From https://github.com/chenglou/react-motion/wiki/v0.4.0-examples/_compare/b23bda218bfc5414d2bb70c954c7ed5250e16fa2...6b4990a7adb5a28a633797f2cebc29ff3a21e363

Ah! Thanks. For reference for anyone else who is upgrading: https://github.com/chenglou/react-motion/wiki#upgrading-from-03-to-040

For google: the key should be a string, I didn't notice my that my key was a number.

Why do I get the feeling that this should mentioned as a error coming from "React-Motion" - Il create a PR when I get the chance ~ Shouldn't have to look on google to find that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haxxxton picture haxxxton  路  4Comments

DanielRuf picture DanielRuf  路  4Comments

boyswan picture boyswan  路  9Comments

sdras picture sdras  路  10Comments

ryanking1809 picture ryanking1809  路  3Comments