# react-native-easy-toast **Repository Path**: mirrors_crazycodeboy/react-native-easy-toast ## Basic Information - **Project Name**: react-native-easy-toast - **Description**: A react native module to show toast like android, it works on iOS and Android. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # react-native-easy-toast 一款简单易用的 Toast 组件,支持 Android&iOS。 [ ![release](https://img.shields.io/github/release/crazycodeboy/react-native-easy-toast.svg?maxAge=2592000?style=flat-square)](https://github.com/crazycodeboy/react-native-easy-toast/releases) [ ![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](https://github.com/crazycodeboy/react-native-easy-toast/pulls) [ ![NPM version](http://img.shields.io/npm/v/react-native-easy-toast.svg?style=flat)](https://www.npmjs.com/package/react-native-easy-toast) [![License MIT](http://img.shields.io/badge/license-MIT-orange.svg?style=flat)](https://raw.githubusercontent.com/crazycodeboy/react-native-easy-toast/master/LICENSE) [ ![language English](https://img.shields.io/badge/language-English-yellow.svg)](https://github.com/crazycodeboy/react-native-easy-toast/) ## 目录 - [安装](#安装) - [Demo](#demo) - [如何使用?](#如何使用?) - [API](#api) - [贡献](#contribution) ## 安装 * 1.在终端运行 `npm i react-native-easy-toast --save` * 或者 `yarn add react-native-easy-toast` * 2.在要使用`Toast`的js文件中添加`import Toast, {DURATION} from 'react-native-easy-toast'` ## Demo * [Examples](https://github.com/crazycodeboy/react-native-easy-toast/tree/master/examples) ![Screenshots](https://raw.githubusercontent.com/crazycodeboy/react-native-easy-toast/master/examples/Screenshots/react-native-easy-toast-screenshots.gif) ## 如何使用? >第一步: 在你的js文件中导入 `react-native-easy-toast`: `import Toast, {DURATION} from 'react-native-easy-toast'` >第二步: 将下面代码插入到`render()`方法中: ```javascript render() { return ( ... this.toast = toast}/> ); } ``` >注意: 请将` this.toast = toast}/>` 放在最外层View的底部。 >第三步: 使用: ```javascript this.toast.show('hello world!'); ``` 在需要弹出提示框时使用上面代码即可。 或者像这样 ```javascript this.toast.show(hello world!); ``` ### 用例 ```javascript render() { return (