React Offscreen screenshot

React Offscreen

Author Avatar Theme by Ivliu
Updated: 11 Sep 2025
150 Stars

react offscreen component like vue keep-alive

Overview

React-offscreen, now renamed to Activity, is an innovative solution for managing component visibility in React applications. It allows developers to hide components without fully uninstalling them, streamlining the rendering process and contributing to better performance. With a lightweight package of just 1.2kB, Activity leverages React’s Suspense functionality to enhance user experience by controlling UI states more efficiently.

This tool is particularly beneficial for developers looking to optimize their React applications while maintaining full context support. Its design prioritizes both functionality and ease of integration, making it a valuable addition to any React toolkit.

Features

  • Suspense Integration: Built upon React’s Suspense, ensuring seamless handling of loading states and fallbacks.
  • Lightweight: At only 1.2kB, Activity is easy to integrate without adding significant overhead to your application.
  • Good Performance: Optimized for efficient re-rendering, helping to improve application speed and responsiveness.
  • Full Context Support: Compatible with React’s full context API, allowing for effective state management across different components.
  • Unstable Hooks: Offers hooks for component activation and deactivation, though intended for advanced users and not yet merged into the main branch.
  • Easy Installation: Simplifies the setup process for developers, allowing for quick implementation in existing projects.
  • React Version Compatibility: Designed for React version 16.8 and above, ensuring access to the latest features and improvements.