Skip to content

luoxuhai/react-native-tinykit

react-native-tinykit

npm version license

A lightweight React Native toolkit for iOS, providing essential native utilities.

Features

  • πŸ”„ App Restart - Programmatically restart your React Native application
  • ⚑ Turbo Module - Built with the new architecture for optimal performance
  • πŸ“¦ Lightweight - Minimal footprint with zero dependencies

Requirements

  • React Native >= 0.76
  • iOS only (for now)

Installation

# Using npm
npm install react-native-tinykit

# Using yarn
yarn add react-native-tinykit

iOS Setup

cd ios && pod install

Usage

Restart Application

Restart the React Native application programmatically:

import { restart } from 'react-native-tinykit';

// Restart the app
restart();

Example Use Cases

  • Force reload after language/locale change
  • Reset app state after logout
  • Apply configuration changes that require a restart

API Reference

restart()

Triggers a reload of the React Native application.

restart(): void

Example:

import { restart } from 'react-native-tinykit';

const handleLogout = async () => {
  await clearUserData();
  restart(); // Restart app to reset state
};

Apps Using This Library

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT Β© Darkce


Made with create-react-native-library

About

πŸ“±πŸ”§ A lightweight React Native toolkit for iOS, providing essential native utilities

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks