1import React from "react";
2import { View, Button } from "react-native";
3
4import { showMessage, hideMessage } from "react-native-flash-message";
5
6class MyScreen extends React.Component {
7 render() {
8 return (
9 <View style={{ flex: 1 }}>
10 <Button
11 onPress={() => {
12 /* HERE WE GONE SHOW OUR FIRST MESSAGE */
13 showMessage({
14 message: "Simple message",
15 type: "info",
16 });
17 }}
18 title="Request Details"
19 color="#841584"
20 />
21 </View>
22 );
23 }
24}
1showMessage({
2 message: "My message title",
3 description: "My message description",
4 type: "default",
5 backgroundColor: "purple", // background color
6 color: "#606060", // text color
7});
1showMessage({
2 message: "My message title",
3 description: "My message description",
4 type: "success",
5 onPress: () => {
6 /* THIS FUNC/CB WILL BE CALLED AFTER MESSAGE PRESS */
7 },
8});