# react-native-flash-message **Repository Path**: zy035017/react-native-flash-message ## Basic Information - **Project Name**: react-native-flash-message - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-02 - **Last Updated**: 2024-07-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 

react-native-flash-message

Flash Message is a React Native module to help you easily create highly customizable flashbars, top notifications or alerts (with iPhone X, XR, XS and XS Max "notch" support).

Global Demo of Flash Message Component

npm version npm downloads npm licence help this project

## Installation Since the library is a JS-based solution, to install the latest version of `react-native-flash-message` you only need to run: ```bash npm install --save react-native-flash-message ``` or ```bash yarn add react-native-flash-message ``` ## Try it out You can try out the [Flash Message Playground app](https://exp.host/@lucasferreira/FlashMessagePlayground) to get a tease of the functionalities in this lib. ## Basic Usage The _FlashMessage component_ is built for global use, so you have to instance this component once in your main app screen always as the last inserted component: ```jsx import React from "react"; import { View } from "react-native"; import FlashMessage from "react-native-flash-message"; function App() { return ( {/* GLOBAL FLASH MESSAGE COMPONENT INSTANCE */} {/* <--- here as the last component */} ); } ``` After that you only need to call `showMessage` or `hideMessage` methods from anywhere in your app. If you don't need a global use for _(e.g. will use only in one screen)_ you can instance your _FlashMessage Component_ with a ref ID _(or other capture ref method)_: ```jsx {/* <--- here as the last component always with `ref` as a prop */} ``` ### Show some message Now that you already instantiated the global _FlashMessage component_, when you need to show some message in your app you could use the `showMessage` method in any screen or view. This is a global method that receive a _message object_ with your message detail: ```jsx import React from "react"; import { View, Button } from "react-native"; import { showMessage, hideMessage } from "react-native-flash-message"; function MyScreen() { return (