“flatlist onrefresh bereaksi asli” Kode Jawaban

flatlist onrefresh bereaksi asli

const [isFetching, setIsFetching] = useState(false);

const fetchData = () => {
  dispatch(getAllTopicAction(userParamData));
  setIsFetching(false);
};

const onRefresh = () => {
  setIsFetching(true);
  fetchData();
};

<FlatList
  data={topics}
  keyExtractor={(item) => item.id.toString()}
  renderItem={renderItem}
  onRefresh={onRefresh}
  refreshing={isFetching}
  progressViewOffset={100}
  ListEmptyComponent={<Empty message="No data found." />}
/>;
Dayanaohhnana

flatlist onrefresh bereaksi asli

const [isFetching, setIsFetching] = useState(false);

const fetchData = () => {
  dispatch(getAllDataAction(userParamData));
  setIsFetching(false);
};

const onRefresh = () => {
  setIsFetching(true);
  fetchData();
};

<FlatList
  data={topics}
  keyExtractor={(item) => item.id.toString()}
  renderItem={renderItem}
  onRefresh={onRefresh}
  refreshing={isFetching}
  progressViewOffset={100}
  ListEmptyComponent={<Empty message="No data found." />}
/>;
Dayanaohhnana

Jawaban yang mirip dengan “flatlist onrefresh bereaksi asli”

Pertanyaan yang mirip dengan “flatlist onrefresh bereaksi asli”

Lebih banyak jawaban terkait untuk “flatlist onrefresh bereaksi asli” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya