@daltonr/notifywrite-react-native
v0.3.0
Published
React Native adapter for @daltonr/notifywrite
Maintainers
Readme
@daltonr/notifywrite-react-native
React Native adapter for @daltonr/notifywrite. API-identical to @daltonr/notifywrite-react — useSyncExternalStore lives in react itself, so the same hooks run unchanged in React Native and Expo.
npm install @daltonr/notifywrite @daltonr/notifywrite-react-nativeimport { NotificationEngine } from "@daltonr/notifywrite";
import { NotificationProvider, useNotificationsContext } from "@daltonr/notifywrite-react-native";
const engine = new NotificationEngine({ order: "newest-first" });
function Toasts() {
const { notifications, dismiss } = useNotificationsContext();
return notifications.map(n => (
<Pressable key={n.id} onPress={() => dismiss(n.id)}><Text>{n.message}</Text></Pressable>
));
}See the project README for the full engine API and an Expo demo.
MIT © Richard Dalton
