Skip to content

Commit

Permalink
fix!: remove deprecated durationMs prop (#577)
Browse files Browse the repository at this point in the history
- I previously left in `durationMs` for backward-compatibility so that you could use either, but I forgot to mark the types as optional, so both ended up being required by the typings
  - instead of making them both confusingly optional (no way of doing "one of"), just remove the deprecated `durationMs` in another breaking change

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
  • Loading branch information
agilgur5 authored Sep 12, 2024
1 parent e76346f commit d9a4285
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/duration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { formatDuration } from '../../v2';
* Output a string duration from a number of seconds
*
* @param {number} props.durationS - The number of seconds.
* @param {number} props.durationMs - The number of seconds. DEPRECATED: The "Ms" suffix is incorrect, use props.durationS instead.
*/
export function Duration(props: {durationMs: number, durationS: number}) {
return <span>{formatDuration(props.durationMs || props.durationS, 2)}</span>;
export function Duration(props: {durationS: number}) {
return <span>{formatDuration(props.durationS, 2)}</span>;
}

0 comments on commit d9a4285

Please sign in to comment.