我已將我的react-navigation代碼放入單獨的Routes文件中,然後將其導入到我的App.js文件中。一切工作正常,但我正在使用的Atom /核素的Airbnb ESLint配置和獲取與tintColor錯誤...React-navigation,道具驗證中缺少tintColor
「tintColor在道具驗證缺失」嘗試這樣:
路線.propTypes = {tintColor:PropTypes.string.isRequired,}
但後來得到錯誤 「tintColor PropType定義,但道具從未使用過」
這是代碼的一部分
const Routes =() = {
const ContentNavigator = TabNavigator(
{
Profile: { screen: ProfileStack },
History: { screen: HistoryStack },
Questions: {
screen: QuestionsStack,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon name="question-circle" type="font-awesome" size={20} color=
{tintColor} />
),
},
},
Notifications: { screen: NotificationsStack },
},
{
initialRouteName: 'Profile',
swipeEnabled: true,
tabBarOptions: {
activeTintColor: COLOR_PRIMARY,
},
backBehavior: 'none',
});
我有同樣的問題。任何幫助,將不勝感激! – Vicky