如何将道具传递到组件内部的导航器?

时间:2020-06-15 13:14:10

标签: react-native react-navigation

我想在React Native中重现Instagram搜索视图(我是一个初学者),我想在显示搜索栏的主视图中嵌入Tab导航器,但是如何将搜索字符串传递给每个选项卡为了过滤每个标签内容?

Instagram search tab

 export default function Search() {
        return (
            <View>
               <SearchInput /> // A search input allowing the user to search for a keyword for example
               <SearchTabNavigator /> // 4 Tabs of content which can be dynamically filtered with the search string above
            </View>
        );
    }

我认为事先有一个叫做“ ScreenProps”的东西,但这是一个不推荐使用的功能... 欢迎任何帮助或建议!

0 个答案:

没有答案