Open qudianapp opened 4 years ago
Same problem here
Got this on Android only after upgrading from RN 0.61 to RN 0.63. I guess this came from an update in Metro Bundler.
https://github.com/ptomasroos/react-native-scrollable-tab-view/blob/master/index.js#L3
This seems totally unnecessary and kind of weird that ViewPropTypes is destructuring outside the block a few lines down.
I patched it like this and run on npm postinstall
:
# postinstall.sh
RN_SCROLLABLE_TAB_VIEW_FILE="./node_modules/react-native-scrollable-tab-view/index.js"
if [ -e $RN_SCROLLABLE_TAB_VIEW_FILE ]; then
echo "Patching react-native-scrollable-tab-view to not break on RN 0.63 and new Metro Bundler..."
sed -i '' "s/const { ViewPropTypes } = ReactNative = require('react-native');/const ReactNative = require('react-native'); const { ViewPropTypes } = ReactNative;/g" $RN_SCROLLABLE_TAB_VIEW_FILE || true
fi
It just declares const ReactNative = require('react-native');
before destructuring ViewPropTypes
.
anyone Find solution for this ?
solution for this please
any fix for this?
any fix for this pleeaaaaaaaaaaase
Hi everyone, the above patch did work perfectly for us for more than a year on an app with 30k + users.
The problem is here:
https://github.com/ptomasroos/react-native-scrollable-tab-view/blob/master/index.js#L3
The weird destructuring on Line 3 breaks Metro Bundler. The author just had to write two lines like a normal developer would.
Anyway last year we removed this library completely and wrote our own in-house version, but unfortunately I don't think we will be open sourcing it as it is quite bespoke 😩
Best of luck to everyone fixing or finding an alternative 🙏
terminal logs: