Skip to content

Commit

Permalink
feat: warn deprecated api
Browse files Browse the repository at this point in the history
  • Loading branch information
IVLIU committed Oct 28, 2024
1 parent 9f52145 commit 98cca3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 6 additions & 0 deletions src/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ export const Activity: FC<IProps> = (props) => {
</Suspense>
);
};

/**
* @deprecated
* @description please rename Offscreen to Activity
*/
export const Offscreen = Activity;
12 changes: 2 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export { Activity } from './Activity';
/**
* @deprecated
*/
export { Activity as Offscreen } from './Activity';
export { Activity, Offscreen } from './Activity';

export type { ActivityMode } from './type';
/**
* @deprecated
*/
export type { ActivityMode as OffscreenMode } from './type';
export type { ActivityMode, OffscreenMode } from './type';
5 changes: 5 additions & 0 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import type { ReactNode } from 'react';

export type ActivityMode = 'visible' | 'hidden';

/**
* @deprecated
*/
export type OffscreenMode = ActivityMode;

export interface IProps {
mode: ActivityMode;
children: ReactNode | ((mode: ActivityMode) => ReactNode);
Expand Down

0 comments on commit 98cca3a

Please sign in to comment.