小编sin*_*bod的帖子

如何更新材质底部选项卡徽章文本而不重新渲染所有子组件?

我已经使用createMaterialBottomTabNavigatorredux 来更改徽章文本。这是代码:

class Router extends React.PureComponent {


  constructor(props) {
    super(props);


    this.state = {}
  }
   componentDidMount() { 

    this.props.appAct()
    this.props.getCartAct()
  }

  HomeStack = () => (
    <Stack.Navigator headerMode={'none'}>
        <Stack.Screen name="Home" component={HomeScreen} />
        <Stack.Screen name="Product" component={ProductStack} />
    </Stack.Navigator>
  )
  CartStack = () => (
    <Stack.Navigator headerMode={'none'}>
        <Stack.Screen name="Cart" component={CartScreen} />
        <Stack.Screen name="Product" component={ProductStack} />
    </Stack.Navigator>
 )



  render() {


    let { internet, showIntro } = this.props;

     if (!internet) return <NoInternetScreen />
     if (showIntro) return <AppIntro />

    return (
      <NavigationContainer ref={navigationRef}>
      
       <Tab.Navigator
            style={{ …
Run Code Online (Sandbox Code Playgroud)

react-native redux react-navigation react-navigation-v5

5
推荐指数
1
解决办法
730
查看次数

如何使用expo FileSystem获取文件扩展名?

我正在使用 expo FileSystem 从 CameraRoll 获取照片和视频。有没有办法获得这些文件的扩展名?

react-native expo

3
推荐指数
1
解决办法
6885
查看次数