修复报错

This commit is contained in:
al 2024-09-02 16:50:45 +08:00
parent a281bc10f4
commit 95871ca0db
2 changed files with 27 additions and 4 deletions

View File

@ -1,8 +1,8 @@
import React, { useState, useEffect, useCallback } from "react";
import { Image, TouchableOpacity, View } from "react-native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
// import Stream from "../Stream";
import NoticeNav from "../NoticeDetail";
import Stream from "../Stream";
// import NoticeNav from "../NoticeDetail";
import My from "../My";
import Posts from "../Posts";
import Space from "../Space";
@ -122,6 +122,29 @@ export default function HomeTab({ navigation, route }) {
/>
)}
<Tab.Screen
name="Stream"
component={Stream}
options={{
title: "发现",
headerShown: false,
tabBarIcon: ({ focused, color, size }) => {
if (focused) {
return (
<Image
source={require("../../assets/icon/others/streamfocus.png")}
/>
);
} else {
return (
<Image
source={require("../../assets/icon/others/streamblur.png")}
/>
);
}
},
}}
/>
{/* <Tab.Screen
name="NoticeNav"
component={NoticeNav}
options={{
@ -143,7 +166,7 @@ export default function HomeTab({ navigation, route }) {
}
},
}}
/>
/> */}
<Tab.Screen
name="My"
component={My}

View File

@ -25,7 +25,7 @@ export default function SpaceSearch({ navigation }) {
const [isloading, setIsloading] = useState(false);
const searchRef = useRef(null);
const getData = async (searchValue) => {
if (searchValue.length != 6) {
if (searchValue?.length != 6) {
setIsloading(false);
return;
}