After upgrading to react native 0.59.5
, the app threw the following warning message on simulator:
viewPagerAndroid has been extracted from react-native core...
But there is no import of the viewPagerAndroid
in the component file:
import React, { Component} from 'react';
import { SectionList, View, StyleSheet, Text, TouchableOpacity, Platform, AppRegistry } from 'react-native';
import Moment from 'moment';
import DeviceInfo from 'react-native-device-info';
import { GiftedChat } from 'react-native-gifted-chat';
How to remove the warning?
As of react-native 0.59.0
ViewPagerAndroid has been deprecated. You can see that in the changelog here.
That means that if you want to use ViewPagerAndroid in the future you will need to install it separately. You can see its repo here
You are probably seeing this warning even though you haven’t explicitly used ViewPagerAndroid because one of the dependencies that you are using used it.
Most commonly react-native-gesture-handler or react-native-tab-view both use ViewPagerHandler.
At the moment the warning is just that, a warning. It isn’t going to cause you any issues until support for ViewPagerAndroid is dropped.
You can suppress the YellowBox warning so it won’t show on device. Note even if you suppress the warning it will always show in the logs.
Import it from react-native
import { YellowBox } from 'react-native';
Then in your App.js
YellowBox.ignoreWarnings(['ViewPagerAndroid']);
You can read more about suppressing warnings here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With