简体   繁体   中英

react-native app ios native-base issue in redux app

Hi guys I am creating react native app using redux, react-native cli and having some issue when starting app it shows as screen shot, i saw online solution mentioning add as below

 <NativeBaseProvider>
       <Example/>
    </NativeBaseProvider>

the problem is I am using redux so when I use like this another redux issue is popping up. also another solution i tried to unlink native base and then remove and then install then also problem occurs.can anyone suggest me a solution to figure out whats happening and could please show way to solve?

在此处输入图像描述


when i use NativeBaseProvider i get this error

在此处输入图像描述

import { NativeBaseProvider, useTheme } from 'native-base'

function AppRedux () {
  // not sure where you are getting this modified value from
  const modified = true
  const { colors } = useTheme()

  return !modified ? ( 
    <View style={{ backgroundColor: '#000' }} />
  ) : (
    <View style={{ backgroundColor: colors.primary }} />
  )
}

export default function App() {
  return (
    <NativeBaseProvider>
      <Provider store={store}> 
        <AppRedux /> 
      </Provider> 
    </NativeBaseProvider> 
  );
}

Official docs for useTheme from native-base are here: https://docs.nativebase.io/theme

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM