0

using this package for wheel selector, and works fine, I just need to select value programmatically with animation(as happen user did).

Here is source code, which works cool, just need prop to select programmatically.

import React, { useRef, useMemo, useEffect, useState } from "react";
import { LinearGradient } from "expo-linear-gradient";

import WheelPickerExpo from "react-native-wheel-picker-expo";

const CITIES = "Jakarta,Bandung,Sumbawa,Taliwang,Lombok,Bima".split(",");

const ActionSheet = () => {
  const [selectedRate, setSelectedRate] = useState(0);

  useEffect(() => {
    setTimeout(() => {
      setSelectedRate(2);//changing initial select doesnt animate.
    }, 4000);
  }, []);

  
  return (
            <WheelPickerExpo
              height={300}
              width="100%"
              initialSelectedIndex={selectedRate}
              items={CITIES.map(name => ({ label: name, value: "" }))}
              onChange={({ item }) => {
                console.log(`item`, item);
              }}
            />
         
  );
};


export default ActionSheet;
HappyDev
  • 1
  • 2

0 Answers0