Browse Source

ref(js): Improve defaultProps typing in durationPercentileChart (#25526)

Evan Purkhiser 3 years ago
parent
commit
af77502c60
1 changed files with 7 additions and 5 deletions
  1. 7 5
      static/app/components/pagination.tsx

+ 7 - 5
static/app/components/pagination.tsx

@@ -11,7 +11,7 @@ import {t} from 'app/locale';
 import {callIfFunction} from 'app/utils/callIfFunction';
 import parseLinkHeader from 'app/utils/parseLinkHeader';
 
-const defaultProps = {
+const defaultProps: DefaultProps = {
   size: 'small',
   onCursor: (cursor: string, path: string, query: Query, _direction: number) => {
     browserHistory.push({
@@ -21,14 +21,16 @@ const defaultProps = {
   },
 };
 
-type DefaultProps = Readonly<typeof defaultProps>;
+type DefaultProps = {
+  size?: 'zero' | 'xsmall' | 'small';
+  onCursor?: (cursor: string, path: string, query: Query, _direction: number) => void;
+};
 
-type Props = {
+type Props = DefaultProps & {
   className?: string;
   pageLinks: string | null | undefined;
-  size?: 'zero' | 'xsmall' | 'small';
   to?: string;
-} & DefaultProps;
+};
 
 class Pagination extends React.Component<Props> {
   static contextTypes = {