From 84d82bb20e017a3b34aeceb936e4021cb7fb3c62 Mon Sep 17 00:00:00 2001 From: redhoodsu Date: Thu, 16 May 2024 18:00:57 +0800 Subject: [PATCH] release(image-viewer): v0.5.1 --- index.json | 2 +- src/image-viewer/package.json | 2 +- src/image-viewer/react.tsx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.json b/index.json index 9544442..dc54337 100644 --- a/index.json +++ b/index.json @@ -118,7 +118,7 @@ }, "image-viewer": { "react": true, - "version": "0.5.0", + "version": "0.5.1", "style": true, "icon": false, "test": true, diff --git a/src/image-viewer/package.json b/src/image-viewer/package.json index 4135bb6..b95161c 100644 --- a/src/image-viewer/package.json +++ b/src/image-viewer/package.json @@ -1,6 +1,6 @@ { "name": "image-viewer", - "version": "0.5.0", + "version": "0.5.1", "description": "Single image viewer", "luna": { "react": true diff --git a/src/image-viewer/react.tsx b/src/image-viewer/react.tsx index 1c74cd3..b9ce365 100644 --- a/src/image-viewer/react.tsx +++ b/src/image-viewer/react.tsx @@ -1,6 +1,7 @@ import { CSSProperties, FC, useEffect, useRef } from 'react' import ImageViewer, { IOptions } from './index' import each from 'licia/each' +import { useNonInitialEffect } from 'src/share/hooks' interface IImageViewerProps extends IOptions { style?: CSSProperties @@ -25,7 +26,7 @@ const LunaImageViewer: FC = (props) => { }, []) each(['image', 'zoomOnWheel'], (key: keyof IOptions) => { - useEffect(() => { + useNonInitialEffect(() => { if (imageViewer.current) { imageViewer.current.setOption(key, props[key]) }