![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
react-native-fast-toast
Advanced tools
A Toast component for react-native, supports Android, IOS, Web, Windows
Readme
A Toast component for react-native, supports Android, IOS, Web, Windows
Open a Terminal in the project root and run:
yarn add react-native-fast-toast
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(() => {
toast.current.show("Task finished successfully");
}, []);
return (
<>
<RestOfYourApp />
<Toast ref={toast} />
</>
);
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)
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.
toast.current.show('Task finished successfully', { type: 'success' })
toast.current.show('Task finished successfully', { icon: <Icon /> })
or
<Toast
ref={toast}
icon={<Icon />}
successIcon={<SuccessIcon />}
dangerIcon={<DangerIcon />}
warningIcon={<WarningIcon />}
/>
}
toast.current.show('Task finished successfully', {
duration: 5000,
style: { padding: 0 },
textStyle: { fontSize: 20 }
})
You can customize default options in Toast component
<Toast ref={toast} duration={5000} textStyle={{ fontSize: 20 }} />
Pull request are welcome.
While developing, you can run the example app to test your changes.
FAQs
[![Version][version-badge]][package] [![MIT License][license-badge]][license]
The npm package react-native-fast-toast receives a total of 2,756 weekly downloads. As such, react-native-fast-toast popularity was classified as popular.
We found that react-native-fast-toast 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.