9

我正在尝试在我的 react-native 应用程序中实现搜索表单。为此,我需要 react-select 或 select-2 之类的东西,这两个工具都是为 Web 系统制作的,我不知道将它用于 react-native 应用程序是否是个好主意。

我已经尝试在 react-native 中安装和使用它,但这似乎不起作用。

4

3 回答 3

4

您不能将 select2 或 react-select 与 react-native 一起使用,因为它是基于 DOM 的,因此它只能在 navigator 中工作,而不是在 react-native

我发现的最接近的 react-native 等价物是 react-native-multiple-select,您可以在 github 上的https://github.com/toystars/react-native-multiple-select上找到它或安装它

npm i react-native-multiple-select
于 2018-09-13T13:55:59.687 回答
3

与 React Native 捆绑的最接近您想要的可能是http://facebook.github.io/react-native/docs/picker.html

Picker 组件将在 iOS 上为您提供不倒翁,在 Android 上为您提供下拉菜单

或者,这个第 3 方组件可能更接近您想要的:https ://github.com/bulenttastan/react-native-list-popover

来自如何使用 React Native 选择框

于 2017-03-30T19:10:43.047 回答
-1
import {useSelector} from 'react-redux';


let filter = useSelector(state => {
    console.log('K___1  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& : ', state);  
    return state;
});


 //using this to fetch all store data in redux-Store
于 2021-01-22T04:24:06.677 回答