Skip to content

Commit 12beafe

Browse files
M-i-k-e-lethanshar
authored andcommitted
Fix crash on Android following RN71 (flex shadow node) (#2536)
1 parent 5348ca1 commit 12beafe

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/components/text/index.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,20 @@ class Text extends PureComponent<PropsTypes> {
103103
}
104104

105105
render() {
106-
const {modifiers, style, center, uppercase, underline, children, forwardedRef, ...others} = this.props;
106+
const {
107+
// (!) extract flex prop to avoid passing them on Android
108+
/* eslint-disable */
109+
flex,
110+
/* eslint-enable */
111+
modifiers,
112+
style,
113+
center,
114+
uppercase,
115+
underline,
116+
children,
117+
forwardedRef,
118+
...others
119+
} = this.props;
107120
const color = this.props.color || modifiers.color;
108121
const {margins, typography, backgroundColor, flexStyle} = modifiers;
109122
const textStyle = [
@@ -154,7 +167,6 @@ const styles = StyleSheet.create({
154167

155168
export {Text}; // For tests
156169

157-
158170
const modifiersOptions = {
159171
color: true,
160172
margins: true,

src/incubator/TextField/Input.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ const DEFAULT_INPUT_COLOR: ColorType = {
1414
};
1515

1616
const Input = ({
17+
// (!) extract flex prop to avoid passing them on Android
18+
/* eslint-disable */
19+
// @ts-ignore (does not exist on props)
20+
flex,
21+
/* eslint-enable */
1722
style,
1823
hint,
1924
color = DEFAULT_INPUT_COLOR,

0 commit comments

Comments
 (0)