& Props> {
function addName & Props>(
StyledComponent: React.ComponentType
- ) {
+ ): React.ComponentType
{
// Use optional chaining to handle circular dependencies where Component
// may be undefined during module loading.
StyledComponent.displayName =
@@ -65,7 +79,7 @@ export function styled(
if (typeof rv === 'function') {
const stylerNarrowed = styler as (
theme: Theme
- ) => (props: Props) => ValidStyles | ValidStyles[]
+ ) => (props: Props) => ValidAnimatedStyles | ValidAnimatedStyles[]
return addName(function StyledComponent(props) {
const theme = useTheme()
const style = stylerNarrowed(theme)(props)
@@ -110,7 +124,12 @@ export function styled(
export function styledWithRef[(
Component: React.ComponentType
-) {
+): (
+ styler: Styler
+) => React.ForwardRefExoticComponent<
+ React.PropsWithoutRef & Props> &
+ React.RefAttributes][
+> {
type RefAttribute = React.RefAttributes][
type PropsWithoutStyle = Omit
@@ -138,7 +157,7 @@ export function styledWithRef][(
if (typeof rv === 'function') {
const stylerNarrowed = styler as (
theme: Theme
- ) => (props: Props) => ValidStyles | ValidStyles[]
+ ) => (props: Props) => ValidAnimatedStyles | ValidAnimatedStyles[]
return addName(
React.forwardRef(
function StyledComponent(props, ref) {
diff --git a/src/components/icons/ThemedIcons.tsx b/src/components/icons/ThemedIcons.tsx
index 29edb725397..544d88c12fd 100644
--- a/src/components/icons/ThemedIcons.tsx
+++ b/src/components/icons/ThemedIcons.tsx
@@ -59,7 +59,11 @@ function AnimatedFontIcon(
const style = useAnimatedStyle(() => ({
color: color?.value ?? defaultColor,
fontFamily,
- fontSize: size?.value ?? defaultSize,
+ // Clamp to a positive value: the new architecture's Android text layout
+ // throws "FontSize should be a positive value" when an animated icon size
+ // reaches 0 (e.g. while an icon collapses out). The container still
+ // animates to zero width, so the icon stays visually hidden.
+ fontSize: Math.max(size?.value ?? defaultSize, 1),
fontStyle: 'normal',
fontWeight: 'normal'
}))
diff --git a/src/components/modals/LogsModal.tsx b/src/components/modals/LogsModal.tsx
index 343573e0b0a..8d55ad0feeb 100644
--- a/src/components/modals/LogsModal.tsx
+++ b/src/components/modals/LogsModal.tsx
@@ -45,8 +45,8 @@ export const LogsModal: React.FC = props => {
)
return () => {
- keyboardDidShowListener.remove()
- keyboardDidHideListener.remove()
+ keyboardDidShowListener?.remove()
+ keyboardDidHideListener?.remove()
}
}, [])
diff --git a/src/components/scenes/GettingStartedScene.tsx b/src/components/scenes/GettingStartedScene.tsx
index 3083e8f27f3..179917ec209 100644
--- a/src/components/scenes/GettingStartedScene.tsx
+++ b/src/components/scenes/GettingStartedScene.tsx
@@ -406,6 +406,7 @@ export const GettingStartedScene: React.FC = props => {
]