Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Version 2 πŸ₯³ πŸš€

Latest

Choose a tag to compare

@kuraydev kuraydev released this 09 Apr 12:48
· 1 commit to master since this release

πŸš€ Major Changes

  • Complete rewrite of the modal system for better stability and type safety
  • Introduced new modal types: Simple, Styled, and Full Screen
  • Improved TypeScript support with better type definitions
  • New singleton pattern for ModalController ensuring consistent modal state

✨ New Features

  • Full Screen Modal Support

    • Added isFullScreen prop for edge-to-edge modals
    • Proper handling of status bar and device safe areas
    • Background color customization through containerStyle
  • Enhanced Modal Types

    • Simple Modal: Basic modal with minimal styling
    • Styled Modal: Pre-styled modal with animations
    • Full Screen Modal: Edge-to-edge modal support
  • Improved Animation System

    • Smoother transitions between states
    • Customizable animation types per modal
    • Better handling of modal mounting/unmounting

πŸ’ͺ Improvements

  • Better ref handling with useImperativeHandle
  • Improved state management using useStateWithCallback
  • Enhanced backdrop handling and touch events
  • Better support for custom styling through containerStyle
  • More consistent modal positioning and layout

πŸ›  Breaking Changes

  • Changed modal ref handling system
  • Updated modal show/hide method signatures
  • Removed deprecated styling props in favor of containerStyle
  • Changed default animation behavior
  • Updated TypeScript definitions for stricter type checking

πŸ“š Documentation

  • Completely revamped documentation with detailed examples
  • Added comprehensive usage guide
  • Included best practices section
  • Added performance optimization tips
  • More code examples and use cases

πŸ› Bug Fixes

  • Fixed modal flickering issues
  • Resolved background color inconsistencies
  • Fixed full-screen modal layout issues
  • Improved handling of modal state transitions
  • Better error handling for modal operations

🧹 Maintenance

  • Updated dependencies to latest versions
  • Improved code organization
  • Better TypeScript integration
  • Enhanced error messages and debugging
  • Removed deprecated code and methods

πŸ“± Example App

  • New example app showcasing all modal types
  • Added more usage examples
  • Improved demo animations
  • Better code organization in examples

πŸ”„ Migration Guide

To upgrade from 1.x to 2.0.0:

  1. Update your imports:
import GlobalModal, { ModalController } from "react-native-global-modal-2"
  1. Update modal ref setup:
const modalRef = useRef<GlobalModalRef>(null);

React.useEffect(() => {
  if (modalRef.current) {
    ModalController.setModalRef(modalRef);
  }
}, []);
  1. Update modal show calls:
// Old
modal.show(<Content />);

// New
ModalController.show({
  content: <Content />,
  // optional props
  isFullScreen: false,
  containerStyle: {},
  onShow: () => {},
  onHide: () => {},
});

Full Changelog: 1.3.0...2.0.0