Demo3 (todoList), TransitionMotion: "defaultStyles" and "styles" => got object, array expected
See original GitHub issueI’m adapting react-motion (stable) demos in our very new template app (meteor-react-es6), to transform each of them in a single component (ex: <DraggableList/>
), using react-motion npm package and React.Component
(instead of React.createClass
).
So it only demands a syntax adaptation, but variables still the same…
The original file
My component
here (shortcut to TransitionMotion)
Console
Warning: Failed propType: Invalid prop "defaultStyles" of type "object" supplied to "TransitionMotion", expected an array. Check the render method of "ListAnimated"
Warning: Failed propType: Invalid prop "styles" supplied to "TransitionMotion". Check the render method of "ListAnimated"
Error Uncaught TypeError: defaultStyles.map is not a function
Any idea guys??
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Array.from() - JavaScript - MDN Web Docs
The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
your code
original code
getDefaultStyles
returned array of styles.getDefaultValue
returns object. Object does not havemap
method.@MadeInMoon ah, sorry, I thought you are going to PR these changes to
react-motion
.I am closing this for now, feel free to ping me in https://gitter.im/nkbt/help or Reactiflux if you need more help!