google-fabric / velocity-react

React components for Velocity.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error caused by require TransitionGroup module directly

yvesyao opened this issue · comments

I encountered an error today:

react.development.js:369 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `VelocityTransitionGroup`.
    in VelocityTransitionGroup (created by TreeNode)

Then I debugged into the error part and found that VelocityTransitionGroup created a child of Object:
image

The following codes shows that this error is caused by requiring TransitionGroup module directly rather than require the default part of the module.
https://github.com/google-fabric/velocity-react/blob/v1.4.1/src/velocity-transition-group.js#L56
https://github.com/reactjs/react-transition-group/blob/v2.7.0/src/TransitionGroup.js#L169

This appears to be related to a breaking minor bump here:
reactjs/react-transition-group#475

I know that an update is coming soon but have you guys found any fixes for this?

@joelhoelting For now you can just explicitly require version 2.6.1 of react-transition-group

This issue has been resolved in version 2.7.1:
reactjs/react-transition-group#475