0.0.7 • Published 10 months ago

react-native-dan-forden v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

react-native-dan-forden

npm.io


Features

  • Works on native platforms (iOS, Android), Expo, and Web
  • Works with react-navigation and Modal (doesn't get hidden)
  • Animations using Reanimated
  • Override with your own simple Toast component

Getting Started

Installation

yarn add react-native-dan-forden

Dependencies

If you are using something like Expo, you should be all set.

If you are using a vanilla React Native setup, you will need some dependencies that you probably should have installed anyways: react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-screens

Note: dependencies only required for native platforms

Usage

  1. Add ToastProvider to your horizontal tree:
// App.tsx
import { ToastProvider } from "react-native-dan-forden";

export default function App() {
  return <ToastProvider>...</ToastProvider>;
}
  1. Use showToast when stuff happens:
import { showToast } from "react-native-dan-forden";

export default function SignUp() {
  async function onSubmit() {
    try {
      await login();
      showToast({
        type: "success",
        message: "Welcome!",
      });
    } catch (err) {
      showToast({
        type: "danger",
        message: "Your signup failed",
      });
    }
  }

  return (
    <Pressable onPress={onSubmit}>
      <Text>Sign Up</Text>
    </Pressable>
  );
}
0.0.7

10 months ago

0.0.6

10 months ago

0.0.3

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago