kgabryje commented on a change in pull request #18105: URL: https://github.com/apache/superset/pull/18105#discussion_r788649849
########## File path: superset-frontend/src/explore/components/RowCountLabel.tsx ########## @@ -31,11 +31,20 @@ const propTypes = { loading: PropTypes.bool, }; +type RowCountLabelProps = { + rowcount?: number; + limit?: number; + rows?: string; + suffix?: string; + loading?: boolean; +}; + const defaultProps = { Review comment: To make sure that `defaultProps` types follow are compatible with `RowCountLabelProps`, we should either add `& typeof defaultProps` to type definition or... get rid of defaultProps and just do `const { rowcount, limit, suffix = t('rows'), loading } = props;`. According to https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/default_props/, the second solution is preferred ########## File path: superset-frontend/src/explore/components/RowCountLabel.tsx ########## @@ -31,11 +31,20 @@ const propTypes = { loading: PropTypes.bool, }; +type RowCountLabelProps = { + rowcount?: number; + limit?: number; + rows?: string; + suffix?: string; + loading?: boolean; +}; + const defaultProps = { Review comment: To make sure that `defaultProps` types are compatible with `RowCountLabelProps`, we should either add `& typeof defaultProps` to type definition or... get rid of defaultProps and just do `const { rowcount, limit, suffix = t('rows'), loading } = props;`. According to https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/default_props/, the second solution is preferred -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org