npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-smart-review

v0.1.0

Published

Tiny React Native hook for asking the user to rate your app and redirecting to the store when appropriate.

Readme

react-native-smart-review

A tiny React Native / Expo hook that presents a friendly in-app rating modal and triggers the native in-app review dialogs (with a store fallback) when the user leaves a high enough rating.

Installation

npm install react-native-smart-review
# or
yarn add react-native-smart-review

The native modules required for the App Store / Play Store dialogs ship with this package.

  • iOS: run npx pod-install after installing the package.
  • Android: rebuild your app so Gradle picks up the new module.
  • Expo: supported in managed and bare workflows. In managed apps run expo prebuild (or build/custom dev client via EAS) after installing so the native code is compiled into your bundle.

Usage

import { Button } from 'react-native';
import { useBetterAppReview } from 'react-native-smart-review';

export function HomeScreen() {
  const { openReview, ReviewModal } = useBetterAppReview({
    iosAppId: '1234567890',
    androidPackageName: 'com.example.app',
    minStarsToRedirect: 4,
    reviewDoneMessage: 'Thanks for letting us know!',
  });

  return (
    <>
      <ReviewModal />
      <Button title="Rate the app" onPress={openReview} />
    </>
  );
}

API

  • iosAppId: Required on iOS. The numeric App Store identifier.
  • androidPackageName: Required on Android. Your Play Store package name.
  • minStarsToRedirect: (default 4) Minimum star rating that triggers the in-app review flow.
  • reviewDoneMessage: Optional message shown if the user submits a rating below the threshold.
  • reviewTitle, reviewBody: Copy overrides inside the modal.
  • submitButtonLabel, cancelButtonLabel: Button overrides.
  • redirectErrorTitle, redirectErrorMessage: Shown when the store fallback cannot be opened.
  • onReviewFinished: Callback invoked after the flow completes. Receives { rating, redirected, error }.

The hook returns:

  • openReview: Function to show the modal.
  • ReviewModal: Render this component near the root so the modal can mount.
  • isVisible: Modal visibility flag.
  • dismiss: Imperative dismiss helper.

How it works

  1. Call openReview() to show the modal.
  2. The user picks a rating from 1 to 5.
  3. Ratings equal to or above minStarsToRedirect first try to launch the native in-app review dialog. If that isn't available (for example on simulators or unsupported OS versions), the hook falls back to opening the store listing. If both attempts fail, a friendly alert is shown instead.
  4. Lower ratings close the modal and show reviewDoneMessage (if provided).

License

MIT License