
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
react-native-web-refresh-control
Advanced tools
An implementation of React Native's RefreshControl for web, since react-native-web currently does not provide one
Drop-in RefreshControl component for web
npm i react-native-web-refresh-control
You can go ahead and use the package!
You will need to configure webpack to parse JSX in node_modules/react-native-web-refresh-control
.
react-scripts
with npm run eject
. Make sure to know what ejecting is before doing it.babel-loader
module in config/webpack.config.js
.
include: paths.appSrc,
with include: [paths.appSrc, /node_modules\/react-native-web-refresh-control/],
react-native-web-refresh-control
exports two properties:
patchFlatListProps
is a function that you can call at some point, while your app is loading. It replaces the default value of the refreshControl prop of FlatList
RefreshControl
can be used to easily give ScrollView
a pull-to-refresh functionality, just like the RefreshControl
exported from react-native. However, if you used the RefreshControl
from react-native, it would not work on the web. To see how to do this, check out this snack: https://snack.expo.io/@niciusb/refreshcontrol-example
https://snack.expo.io/@niciusb/refreshcontrol-example
import { RefreshControl } from 'react-native-web-refresh-control'
<ScrollView
refreshControl={
<RefreshControl refreshing={refreshing} onRefresh={reloadLines} />
}
>
<Text>This scrollview will have pull-to-refresh functionality on the web</Text>
</ScrollView>
// index.js
import { patchFlatListProps } from 'react-native-web-refresh-control'
import App from './App'
patchFlatListProps()
registerRootComponent(App)
patchFlatListProps
takes optional options
to customize the refresh control:option | Type | Description | default |
---|---|---|---|
colors | array | If tintColor is not defined, it uses the first color in the array for refresh indicator. | |
enabled | boolean | Whether the pull to refresh functionality is enabled. | true |
size | RefreshControl.SIZE | Size of the refresh indicator. | RefreshLayoutConsts.SIZE.DEFAULT |
tintColor | color | The color of the refresh indicator. | |
title | string | The title displayed under the refresh indicator. | |
titleColor | color | The color of the refresh indicator title. |
// index.js
import { patchFlatListProps } from 'react-native-web-refresh-control'
import App from './App'
// make refresh control red
patchFlatListProps({tintColor: 'red'})
registerRootComponent(App)
FAQs
An implementation of React Native's RefreshControl for web, since react-native-web currently does not provide one
The npm package react-native-web-refresh-control receives a total of 1,700 weekly downloads. As such, react-native-web-refresh-control popularity was classified as popular.
We found that react-native-web-refresh-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.