### Start Sample Project Source: https://github.com/zahidalidev/toastify-react-native/blob/master/CONTRIBUTING.md Starts the development server for the sample project using npm. This command is used to run the sample application for testing purposes. ```sh npm start ``` -------------------------------- ### Install Dependencies (Sample Project) Source: https://github.com/zahidalidev/toastify-react-native/blob/master/CONTRIBUTING.md Installs dependencies specifically for the sample project located in the 'sample' directory. This allows for testing changes in a real React Native environment. ```sh cd sample npm install ``` -------------------------------- ### Install Dependencies (Main Package) Source: https://github.com/zahidalidev/toastify-react-native/blob/master/CONTRIBUTING.md Installs the necessary dependencies for the main toastify-react-native package using npm. This is a required step before developing or testing. ```sh npm install ``` -------------------------------- ### Install toastify-react-native and react-native-vector-icons Source: https://github.com/zahidalidev/toastify-react-native/blob/master/README.md Installs the core toastify-react-native library and its required dependency, react-native-vector-icons, using npm or yarn. Ensure you follow the react-native-vector-icons installation guide for platform-specific setup. ```sh npm install toastify-react-native # or yarn add toastify-react-native ### Required Dependencies This package requires `react-native-vector-icons`: ```sh npm install react-native-vector-icons # or yarn add react-native-vector-icons ``` Follow the [react-native-vector-icons installation guide](https://github.com/oblador/react-native-vector-icons#installation) to complete the setup for your platform. ``` -------------------------------- ### Install toastify-react-native and Dependencies Source: https://github.com/zahidalidev/toastify-react-native/blob/master/README-legacy.md Installs the core toastify-react-native package and its required dependencies, react-native-modal and react-native-vector-icons, using npm. ```sh npm install toastify-react-native npm install react-native-modal react-native-vector-icons ``` -------------------------------- ### Clone Repository and Create Branch Source: https://github.com/zahidalidev/toastify-react-native/blob/master/CONTRIBUTING.md Commands to clone the toastify-react-native repository, navigate into the directory, and create a new local branch for development. Ensures a clean starting point for contributions. ```sh git clone https://github.com/zahidalidev/toastify-react-native.git cd toastify-react-native git checkout -b my-branch ``` -------------------------------- ### Info Toast with Position Example (React Native) Source: https://github.com/zahidalidev/toastify-react-native/blob/master/README-legacy.md Shows how to display an informational toast message at a specified position ('bottom') using the Toast.info() method from toastify-react-native. This example is integrated within a separate component. ```javascript import React from 'react' import { StyleSheet, View, TouchableOpacity, Text } from 'react-native' import { Toast } from 'toastify-react-native' const Another = () => ( Toast.info('Lorem ipsum info', 'bottom')} style={styles.buttonStyle}> SHOW SOME AWESOMENESS! ) const styles = StyleSheet.create({ container: { backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, buttonStyle: { marginTop: 10, backgroundColor: 'white', borderColor: 'green', borderWidth: 2, padding: 10, }, }) export default Another ``` -------------------------------- ### Basic Toast Notification Example (React Native) Source: https://github.com/zahidalidev/toastify-react-native/blob/master/README-legacy.md Demonstrates how to set up and display a success toast notification within a React Native application. It requires importing ToastManager and Toast from 'toastify-react-native' and calling Toast.success(). ```javascript import React from 'react' import { StyleSheet, View, TouchableOpacity, Text } from 'react-native' import ToastManager, { Toast } from 'toastify-react-native' import Another from './Another' const App = () => { const showToasts = () => { Toast.success('Promised is resolved') } return ( SHOW SOME AWESOMENESS! ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, }) export default App ``` -------------------------------- ### React Native: Display Error Toast with Toast.error() Source: https://context7.com/zahidalidev/toastify-react-native/llms.txt Provides an example of displaying error toast notifications in React Native using Toast.error(). This is useful for handling failure scenarios and can be customized with position, icons, icon families, and modal behavior. The example includes a mock network request to trigger the error toast. ```jsx import React from 'react' import { View, Button } from 'react-native' import ToastManager, { Toast } from 'toastify-react-native' export default function App() { const handleError = async () => { try { await performNetworkRequest() } catch (error) { Toast.error('Network request failed', 'top', 'error-outline', 'MaterialIcons', true) } } const performNetworkRequest = async () => { throw new Error('Connection timeout') } return (