Socket
Socket
Sign inDemoInstall

react-native-fast-toast

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-fast-toast - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "react-native-fast-toast",
"version": "1.0.3",
"version": "1.0.4",
"main": "index.ts",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -28,3 +28,3 @@ # react-native-fast-toast

import React, { useEffect, useRef } from "react";
import { View, StyleSheet } from "react-native";
import { View } from "react-native";
import Toast from "react-native-fast-toast";

@@ -47,2 +47,27 @@

## Global Example
If you want to have one Toast and use it everywhere on your app. do this in root component of your app (index.js or App.js)
```js
import React, { useEffect, useRef } from "react";
import { View } from "react-native";
import Toast from "react-native-fast-toast";
export default function App() {
const toast = useRef(null);
useEffect(() => {
// Here
global['toast'] = toast.current
}, []);
return (
<>
<RestOfYourApp />
<Toast ref={toast} />
</>
);
```
now you can call ```toast.show()``` everywhere on app. like alert.
## Type Example

@@ -49,0 +74,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc