“Flatlist Onrefresh React Native” Code-Antworten

Flatlist Onrefresh React Native

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 React Native

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

Ähnliche Antworten wie “Flatlist Onrefresh React Native”

Fragen ähnlich wie “Flatlist Onrefresh React Native”

Weitere verwandte Antworten zu “Flatlist Onrefresh React Native” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen