
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-fresh-flatlist
Advanced tools
Do you need to update FlatList data frequently? Are people constantly complaining that they don't see the most up-to-date information? Try using this component by simply entering data. Refreshing is the responsibility of this component, Get away from data refreshing logic and focus on other things.
npm install react-native-fresh-flatlist
# or
yarn add react-native-fresh-flatlist
function SampleList() {
const navigation = useNavigation();
const isFocused = useIsFocused();
const renderItem = useCallback(
({ item, index }: { item: Board; index: number }) => {
return (
<Pressable
style={{ backgroundColor: 'gray', gap: 8, padding: 12 }}
onPress={() => navigation.navigate('DetailScreen', { item })}
>
<View>
<Text style={{ fontWeight: 'bold' }}>index : {index}</Text>
<Text>{item.content}</Text>
</View>
<Pressable
onPress={() => {
// If you want to refresh the page to which the item belongs after changing the status of the item.
// Example)
freshFlatListRef.current?.refreshWatching(index);
}}
>
<Text>LIKE!</Text>
</Pressable>
</Pressable>
);
},
[navigation]
);
const fetchList = useCallback(
async (fetchInputMeta: FetchInputMeta<T>) => {
const { fetchPage } = fetchInputMeta;
// Enter your fetch logic here.
const response = await fetch(`https://api.example.com/boards?page=${fetchPage}`);
const data: {
list: Array<T>;
isLast: boolean;
} = await response.json();
let list: T[] = [];
if (data && data.list && data.list.length > 0) {
list = data.list;
}
return {
list: list as Board[],
isLastPage: data.isLast,
}
},
[category, ownerId, size]
);
return (
<FreshFlatList<T>
ref={freshFlatListRef}
isFocused={isFocused}
fetchList={fetchList}
renderItem={renderItem}
/>
)
};
FreshFlatListProps<T>| Prop | Type | Description |
|---|---|---|
fetchList | (fetchInputMeta: FetchInputMeta<T>) => FetchOutputMeta<T> | Required. Function to fetch the list data. |
isFocused | boolean | Optional. refresh watchging list if the screen is focused. |
unshiftData | T[] | Optional. If there is data you want to add in front of data. ex) for filter bar |
initData | T[] | Optional. If you want to reduce fetch by utilizing cached data. ( Not recommended. ) |
fetchCoolTime | number | Optional. Time to prevent the issue of quickly calling the API with the same params multiple times. |
FlatListComponent | ComponentType<FlatListProps<T>> typeof Animated.FlatList<T> | Optional. If you need animation processing using Animated.FlatList or Reanimated.FlatList |
LoadingComponent | ReactNote | Optional. Loading component. |
FetchInputMeta<T>| Prop | Type | Description |
|---|---|---|
fetchType | 'first' | 'watching' | 'end-reached' | Type of fetch operation. |
fetchPage | number | Page number to fetch. When the fetchList function is first executed, it is 1. |
previousAllData | T[] | Data held by Fresh FlatList before fetchList function was completed. |
FetchOutputMeta<T>| Prop | Type | Description |
|---|---|---|
list | T[] | Required. Fetched list data. Calculated cumulatively within FreshFlatList |
isLastPage | boolean | If you enter true in isLastPage, fetch will not occur even if the end of the list is reached. |
isRenderReady | boolean | The Loading component is displayed until isRenderReady is returned with true at least once. |
FYIThe base of this component is FlatList, so FlatListProps can be used, but the following props cannot be used.
FreshFlatListRef| Method | Parameter | Type | Description |
|---|---|---|---|
reset | index | number undefined | Resets the list to the initial state. If the index is given, the page containing the index is refreshed. If not, the current watching page is refreshed. |
refreshWatching | void | number | Refreshes the current page of the list. |
flatList | This is the "flatList ref" inside the FreshFlatList. |
| Hook | Description |
|---|---|
usePageKeyMapper | If the API's next fetch information is id-based, this component can be used. |
useCacheInitData | A hook that can help if you want to save caching data and apply it to the initData prop. |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
fresh fresh fresh list!
We found that react-native-fresh-flatlist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.