@ssgoi/react
Version:
React bindings for SSGOI - Native app-like page transitions for React applications
24 lines (23 loc) • 691 B
TypeScript
import { CSSProperties } from 'react';
import { SsgoiContext } from '@ssgoi/core/types';
export * from '@ssgoi/core/types';
/**
* Navigation info containing from/to paths
*/
export type NavigationInfo = {
from: string | null;
to: string;
};
/**
* React-specific context type with style control
*/
export type ReactSsgoiContext = {
/** Get transition config for a path */
getTransition: SsgoiContext;
/**
* Get initial style for an element
* Returns { visibility: "hidden" } on first call if transition is configured, {} otherwise
* Subsequent calls always return {} to prevent re-hiding on rerender
*/
getInitialStyle: () => CSSProperties;
};