react-native-gestures icon indicating copy to clipboard operation
react-native-gestures copied to clipboard

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

Open nguyencaochien opened this issue 7 years ago • 7 comments

nguyencaochien avatar May 18 '17 07:05 nguyencaochien

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

nguyencaochien avatar May 18 '17 07:05 nguyencaochien

me too getting this same error..

kunalailani avatar May 22 '17 13:05 kunalailani

same problem using example in README.md

mayaa6 avatar Jul 18 '17 03:07 mayaa6

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 avatar Jul 20 '17 07:07 kunalailani

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

mayaa6 avatar Jul 21 '17 03:07 mayaa6

I am working on a refactor which should fix this issue: https://github.com/kiddkai/react-native-gestures/pull/30

assertchris avatar Sep 04 '17 12:09 assertchris

Hotfix from my side

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

serhiipalash avatar Sep 05 '17 13:09 serhiipalash