diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index d4cfe18f359c6c..ee276d5b4ec7db 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -32,6 +32,7 @@ import type { PressEvent, } from '../../Types/CoreEventTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import flattenStyle from '../../StyleSheet/flattenStyle'; const {useLayoutEffect, useRef, useState} = React; @@ -1490,13 +1491,12 @@ const ExportedForwardRef: React.AbstractComponent< React.ElementRef> & ImperativeMethods, >, ) { - let style = restProps.style; + let style = flattenStyle(restProps.style); + if (style && style.verticalAlign !== undefined) { - style = StyleSheet.compose(style, { - textAlignVertical: - // $FlowFixMe - verticalAlignToTextAlignVerticalMap[style.verticalAlign], - }); + // $FlowFixMe + style.textAlignVertical = + verticalAlignToTextAlignVerticalMap[style.verticalAlign]; } return ( diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 12e54f01e04ad8..8753e86bf7260f 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -175,6 +175,7 @@ const Text: React.AbstractComponent< } if (style && style.verticalAlign !== undefined) { + // $FlowFixMe[prop-missing] style = StyleSheet.compose(style, { textAlignVertical: verticalAlignToTextAlignVerticalMap[style.verticalAlign],