diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index 22c056dfdfc4..575646f7dd9c 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -29,7 +29,7 @@ type BadgeProps = { textStyles?: StyleProp; /** Callback to be called on onPress */ - onPress: (event?: GestureResponderEvent | KeyboardEvent) => void; + onPress?: (event?: GestureResponderEvent | KeyboardEvent) => void; }; function Badge({success = false, error = false, pressable = false, text, environment = CONST.ENVIRONMENT.DEV, badgeStyles, textStyles, onPress = () => {}}: BadgeProps) { diff --git a/src/components/EnvironmentBadge.js b/src/components/EnvironmentBadge.tsx similarity index 94% rename from src/components/EnvironmentBadge.js rename to src/components/EnvironmentBadge.tsx index f32946f8bc25..c31677a8f5c3 100644 --- a/src/components/EnvironmentBadge.js +++ b/src/components/EnvironmentBadge.tsx @@ -18,7 +18,7 @@ function EnvironmentBadge() { const {environment} = useEnvironment(); // If we are on production, don't show any badge - if (environment === CONST.ENVIRONMENT.PRODUCTION) { + if (environment === CONST.ENVIRONMENT.PRODUCTION || environment === undefined) { return null; }