Open ginnyedelstein opened 2 years ago
const [categoryValue, setCategoryValue] = useState([]);
https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/usage#multiple-items
thanks! can i set it to an initial value? this isnt working: const [radiusValue, setRadiusValue] = useState([ { label: "unlimited", value: "0" }, ]);
useState(0);
will do that for you.
const [categoryOpen, setCategoryOpen] = useState(false); const [categoryValue, setCategoryValue] = useState(null); const [categoryItems, setCategoryItems] = useState([ { label: "General", value: "general" }, { label: "Technology", value: "technology" }, ]); const [radiusOpen, setRadiusOpen] = useState(false); const [radiusValue, setRadiusValue] = useState(null); const [radiusItems, setRadiusItems] = useState([ { label: "5km", value: "5" }, { label: "unlimited", value: "0" }, ]);
const onCategoryOpen = useCallback(() => { setRadiusOpen(false); }, []);
const onRadiusOpen = useCallback(() => { setCategoryOpen(false); }, []);
return (
when i try to select select a value im getting "null is not an object (evaluating 'memoryRef.current.value.includes')