
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
react-native-messages
Advanced tools
React Native notification-like messages
$ npm install react-native-messages
<MessageBar/>
to the top of your view hierarchy, as a last component. If you are using react-navigation
, root navigator should be in place of <App/>
. Root view should have flex: 1
:import { MessageBar } from 'react-native-messages';
<View style={{ flex: 1 }}>
<App/>
<MessageBar/>
<View>
showMessage
in any other component:import { showMessage } from 'react-native-messages';
<Button onPress={() => showMessage('You are awesome!')}/>
Prop | Type | Default |
---|---|---|
messageComponent | Component | Default message component |
duration | Number | 1000 |
slideAnimationOffset | Number | 40 |
showAnimationDuration | Number | 255 |
hideAnimationDuration | Number | 255 |
closeOnSwipe | Boolean | true |
You can add custom config as a second argument to showMessage
call to configure individual messages. E.g. showMessage('You are awesome!', { duration: 3000 })
.
Default message will receive only string, but you can implement your own message component to work with any other objects e.g Error instances. Your message component will also be passed a hideMessage
prop. Simply call hideMessage()
to hide the notification.
function Message({ message, hideMessage }) {
if (message instanceof Error) {
// return error-styled message
} else {
// return normal message
}
}
<MessageBar messageComponent={Message}/>
<Button onPress={() => showMessage(new Error('Boom!'))}/>
$ git clone git@github.com:Qlean/react-native-messages.git
$ cd react-native-messages/demo
$ npm install
$ npm start
$ react-native run-android # assuming Android emulator is running: https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies
Same as demo. Run npm install
in root directory to install ESLint.
FAQs
React Native notification-like messages
We found that react-native-messages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.