Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-native-user-inactivity
Advanced tools
React Native component that notifies if the user is active or not
React Native component that notifies if the user is active or not (i.e. when the app surface hasn't been touched for more than a certain amount of ms).
npm install --save react-native-user-inactivity
yarn add react-native-user-inactivity
import UserInactivity from 'react-native-user-inactivity';
import React, { Component } from 'react';
import { Text } from 'react-native';
import UserInactivity from 'react-native-user-inactivity';
export default class App extends PureComponent {
state = {
active: true,
text: ''
};
onAction = (active) => {
this.setState({
active,
});
}
render() {
const { active } = this.state;
return (
<UserInactivity
timeForInactivity={2000}
onAction={this.onAction}
>
<Text style={styles.paragraph}>
Put your app here:
{
active ? 'Active' : 'Inactive'
}
</Text>
</UserInactivity>
);
}
}
Also, please checkout the example on Snack/Expo.
The time is expressed in milliseconds (ms).
Prop | Type | Explanation | Required | Default Value |
---|---|---|---|---|
timeForInactivity | number | Inactivity time threshold | no | 10000 |
onAction | (boolean) => void | Callback triggered at every action, or lack of action after timeForInactivity ms | yes | - |
style | style | The style of the wrapper | no | { flex: 1 } |
children | React.ReactNode | Nested react nodes to wrap | yes | - |
Of course PRs are welcome!
FAQs
React Native component that notifies if the user is active or not
The npm package react-native-user-inactivity receives a total of 6,951 weekly downloads. As such, react-native-user-inactivity popularity was classified as popular.
We found that react-native-user-inactivity 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.