react-native-masked-view / masked-view

React Native Masked View Library
MIT License
976 stars 125 forks source link

MaskView.js file: TypeError: Object(...) is not a function #130

Open lexycole opened 3 years ago

lexycole commented 3 years ago

11 | import * as React from 'react'; 12 | import { View, StyleSheet, requireNativeComponent } from 'react-native'; 13 | **> 14 | const RNCMaskedView = requireNativeComponent<any>('RNCMaskedView')**; 15 | 16 | import type { MaskedViewProps } from './MaskedViewTypes';

Please help with this error

busterbogheart commented 3 years ago

Needs more context, and better formatting

clieee commented 3 years ago

I get the same, points out to this line in MaskedView.js: const RNCMaskedView = requireNativeComponent<any>('RNCMaskedView');

Which triggers: TypeError: Object(...) is not a function

Tried out with your github example code in a plain view.


masked-view: 0.1.11
react-native-cli: 2.0.1
react-native: 0.63.2
sergioisidoro commented 2 years ago

Just to leave a comment here for others: This issue seems to be related to reactive native web. It seems mask view is not compatible with the current version with expo web

saqibkafeel commented 2 years ago

any solution ?

sergioisidoro commented 2 years ago

I could not find any workaround, other than that it needs to be implemented https://docs.expo.dev/versions/latest/sdk/masked-view/

msvargas commented 2 years ago

This works for me at the moment

https://github.com/react-native-masked-view/masked-view/issues/70#issuecomment-1171801526