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

Rename to useStyleTransition

Changed files
+5 -3
src
+1 -1
src/index.ts
···
export * from './useMenuFocus';
export * from './useDismissable';
export * from './useScrollRestoration';
-
export * from './useTransition';
+
export * from './useStyleTransition';
+4 -2
src/useTransition.ts src/useStyleTransition.ts
···
for (const propName in style) {
let value: string = style[propName];
-
if (typeof value === 'number') (value as string) += 'px';
+
if (typeof value === 'number' && propName !== 'opacity') {
+
(value as string) += 'px';
+
}
let key: string;
if (/^--/.test(propName)) {
···
});
};
-
export function useTransition<T extends HTMLElement>(
+
export function useStyleTransition<T extends HTMLElement>(
ref: Ref<T>,
options?: TransitionOptions
): [boolean, (options: TransitionOptions) => Promise<void>] {