Mirror: React hooks for accessible, common web interactions. UI super powers without the UI.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rename to useStyleTransition

+5 -3
+1 -1
src/index.ts
··· 3 3 export * from './useMenuFocus'; 4 4 export * from './useDismissable'; 5 5 export * from './useScrollRestoration'; 6 - export * from './useTransition'; 6 + export * from './useStyleTransition';
+4 -2
src/useTransition.ts src/useStyleTransition.ts
··· 18 18 19 19 for (const propName in style) { 20 20 let value: string = style[propName]; 21 - if (typeof value === 'number') (value as string) += 'px'; 21 + if (typeof value === 'number' && propName !== 'opacity') { 22 + (value as string) += 'px'; 23 + } 22 24 23 25 let key: string; 24 26 if (/^--/.test(propName)) { ··· 80 82 }); 81 83 }; 82 84 83 - export function useTransition<T extends HTMLElement>( 85 + export function useStyleTransition<T extends HTMLElement>( 84 86 ref: Ref<T>, 85 87 options?: TransitionOptions 86 88 ): [boolean, (options: TransitionOptions) => Promise<void>] {