From 54d8f221c2edbd9dcd2c41e9c216f397f1b0d8b2 Mon Sep 17 00:00:00 2001 From: Slavik Manukyan Date: Wed, 3 Aug 2016 11:14:48 -0700 Subject: [PATCH] Way to pass styles to nested view Summary: Ability to pass styles to nested view for _position_ behavior. Use case: ``` jsx ``` Closes https://github.com/facebook/react-native/pull/9065 Differential Revision: D3662876 Pulled By: javache fbshipit-source-id: 9b08a04449431c4e563ef4464b5a7dba1fc02e4b --- Libraries/Components/Keyboard/KeyboardAvoidingView.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index a02ba4dbc..afc13c6a5 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -53,7 +53,12 @@ const KeyboardAvoidingView = React.createClass({ propTypes: { ...View.propTypes, behavior: PropTypes.oneOf(['height', 'position', 'padding']), - + + /** + * The style of the content container(View) when behavior is 'position'. + */ + contentContainerStyle: View.propTypes.style, + /** * This is the distance between the top of the user screen and the react native view, * may be non-zero in some use cases. @@ -160,9 +165,11 @@ const KeyboardAvoidingView = React.createClass({ case 'position': const positionStyle = {bottom: this.state.bottom}; + const { contentContainerStyle } = this.props; + return ( - + {children}