Skip to content

Releases: saseungmin/react-native-gesture-image-viewer

react-native-gesture-image-viewer@2.0.0-beta.4

16 Aug 10:55
6bc6057
Compare
Choose a tag to compare

Patch Changes

  • b81f5a3: feat!: add useGestureViewerState hook and refactor controller

    • Add useGestureViewerState hook to access currentIndex and totalCount
    • Refactor useGestureViewerController to return control methods only
    • Rename GestureViewerControllerState to GestureViewerState
    • Update exports and type definitions

    BREAKING CHANGE: useGestureViewerController no longer returns currentIndex and totalCount. Use useGestureViewerState instead.

    Example:

    import {
      GestureViewer,
    -  GestureViewerControllerState,
    +  GestureViewerState
      useGestureViewerController,
      useGestureViewerEvent,
    +  useGestureViewerState,
    } from 'react-native-gesture-image-viewer';
    
    const {
      goToIndex, goToPrevious, goToNext, zoomIn, zoomOut, resetZoom, rotate,
    -  currentIndex, totalCount
    } = useGestureViewerController();
    
    + const { currentIndex, totalCount } = useGestureViewerState();
  • fae40a9: refactor!: remove onIndexChange prop in favor of state hook

    • Remove onIndexChange prop from GestureViewerProps
    • For current index: use useGestureViewerState hook
    • For index changes: use useGestureViewerState with useEffect
    • Update component implementation to remove prop handling

    Example:

    // Before
    <GestureViewer onIndexChange={(index) => console.log(index)} />;
    
    // After
    const { currentIndex } = useGestureViewerState();
    
    useEffect(() => {
      console.log(currentIndex);
    }, [currentIndex]);

    ❗ BREAKING CHANGE: onIndexChange prop removed. Use useGestureViewerState for current index and useEffect for change detection.

  • 37087da: refactor!: improve props naming for better developer experience

    • Replace ambiguous gesture props with clearer names
    • Group dismiss-related options into single object
    • Standardize enable\* pattern for gesture controls

    ❗ BREAKING CHANGE:

    • enableDismissGesturedismiss.enabled
    • dismissThresholddismiss.threshold
    • resistancedismiss.resistance
    • animateBackdropdismiss.fadeBackdrop
    • useSnapenableSnapMode
    • enableZoomPanGestureenablePanWhenZoomed
    • enableZoomGestureenablePinchZoom
    • enableSwipeGestureenableHorizontalSwipe

    Example:

    <GestureViewer
      dismiss={{
        enabled: true,
        threshold: 80,
        resistance: 2,
        fadeBackdrop: true,
      }}
      enableSnapMode
      enablePanWhenZoomed
      enablePinchZoom
      enableHorizontalSwipe
    />
  • 816ab00: docs: complete v2 documentation setup

    • Add v2 guide pages and API documentation
    • Create v2 home pages (en/ko) with feature highlights
    • Add migration guide from 1.x to 2.x with breaking changes
    • Add cross-version compatibility warnings for Reanimated v3/v4
    • Complete API documentation translation (props, hooks, events)
    • Set up v2 as default version in rspress config

react-native-gesture-image-viewer@1.6.5

13 Aug 10:35
3ffe14d
Compare
Choose a tag to compare

Patch Changes

  • a483743: fix(useGestureViewerController): Prevent tearing and optimize rendering

    • Refactors useGestureViewerController to use useSyncExternalStore.
    • This change resolves a potential tearing bug that can occur in concurrent mode by ensuring the hook's state is always synchronized with the external store.
    • Optimized the update logic to prevent unnecessary re-renders when currentIndex or totalCount remain unchanged, improving performance.

react-native-gesture-image-viewer@2.0.0-beta.3

13 Aug 10:36
fdc5cd2
Compare
Choose a tag to compare

Patch Changes

  • 91320d6: fix(useGestureViewerController): Prevent tearing and optimize rendering

    • Refactors useGestureViewerController to use useSyncExternalStore.
    • This change resolves a potential tearing bug that can occur in concurrent mode by ensuring the hook's state is always synchronized with the external store.
    • Optimized the update logic to prevent unnecessary re-renders when currentIndex or totalCount remain unchanged, improving performance.

react-native-gesture-image-viewer@1.6.4

10 Aug 07:04
f6731d3
Compare
Choose a tag to compare

Patch Changes

react-native-gesture-image-viewer@2.0.0-beta.2

10 Aug 07:06
525bc3a
Compare
Choose a tag to compare

Patch Changes

react-native-gesture-image-viewer@1.6.3

08 Aug 02:18
4be9b35
Compare
Choose a tag to compare

Patch Changes

  • a57ddbd: fix: prevent multiple onIndexChange calls during initialization

    • Remove redundant currentIndex state to avoid duplicate callbacks
    • Use manager subscription as single source of truth for index changes
    • Implement ref pattern for onIndexChange to prevent stale closures
    • Ensure onIndexChange only fires on actual user interactions, not internal state changes

    Now onIndexChange correctly fires only once during initialization.

    Fixes #67

react-native-gesture-image-viewer@2.0.0-beta.1

08 Aug 02:29
36b31f8
Compare
Choose a tag to compare

Patch Changes

  • e5f9744: fix: prevent multiple onIndexChange calls during initialization

    • Remove redundant currentIndex state to avoid duplicate callbacks
    • Use manager subscription as single source of truth for index changes
    • Implement ref pattern for onIndexChange to prevent stale closures
    • Ensure onIndexChange only fires on actual user interactions, not internal state changes

    Now onIndexChange correctly fires only once during initialization.

    Fixes #67

react-native-gesture-image-viewer@2.0.0-beta.0

06 Aug 02:35
33dcaab
Compare
Choose a tag to compare

Major Changes

  • db35df7: feat: upgraded react-native-reanimated v4

    Reanimated Configure Migration Guide:

    npm install react-native-worklets
    // babel.config.js
    module.exports = (api) => {
      api.cache(true);
    
      return getConfig(
        {
          presets: ['babel-preset-expo'],
          plugins: [
            // for web
            '@babel/plugin-proposal-export-namespace-from',
            // react-native-worklets/plugin has to be listed last.
    -       'react-native-reanimated/plugin',
    +       'react-native-worklets/plugin',
          ],
        },
        { root, pkg },
      );
    };
    // metro.config.js
    const path = require('path');
    const { getDefaultConfig } = require('@expo/metro-config');
    const { withMetroConfig } = require('react-native-monorepo-config');
    - const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
    
    const root = path.resolve(__dirname, '..');
    
    /**
     * Metro configuration
     * https://facebook.github.io/metro/docs/configuration
     *
     * @type {import('metro-config').MetroConfig}
     */
    const config = withMetroConfig(getDefaultConfig(__dirname), {
      root,
      dirname: __dirname,
    });
    
    config.resolver.unstable_enablePackageExports = true;
    
    - module.exports = wrapWithReanimatedMetroConfig(config);
    + module.exports = config

react-native-gesture-image-viewer@1.6.2

05 Aug 05:39
bd31cbf
Compare
Choose a tag to compare

Patch Changes

react-native-gesture-image-viewer@1.6.1

30 Jul 13:25
4a86226
Compare
Choose a tag to compare

Patch Changes

  • 9e5a6bd: refactor(loop): replace timeout with event-driven loop animation

    • Remove hardcoded 300ms timeout dependency
    • Use onMomentumScrollEnd for accurate animation completion detection
    • Implement callback-based approach for better timing control
    • Handle user scroll interruption during loop transitions