kiddkai / react-native-gestures

Composable React Native Gestures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Element type is invalid :expected String but got : object .... when add <GestureView>

nguyencaochien opened this issue · comments

I saw the error when i put into render method. Please tell me why and how to fix it.

me too getting this same error..

same problem using example in README.md

i solved it by editing GestureView.js file
edit line no 11
export default React.createClass({ mixins: [events(['onLayout']), draggableMixin()],
to
const GestureView = React.createClass({ mixins: [events(['onLayout']), draggableMixin()]

and at the last include one line that exports this class
module.exports = GestureView;

Hope this will help you.

@kunalailani This works. Thanks. But could you explain why this fix works?

I am working on a refactor which should fix this issue: #30

Hotfix from my side

<GestureView.default>
    ...
</GestureView.default>