Added setCustomKeyboardAvoidingView

This commit is contained in:
ajackster
2016-12-25 23:47:30 -05:00
parent ef650ff201
commit 35e87feb19

View File

@@ -0,0 +1,14 @@
import { KeyboardAvoidingView } from 'react-native';
export const setCustomKeyboardAvoidingView = customProps => {
const kbvRender = KeyboardAvoidingView.prototype.render;
Image.prototype.render = function render() {
let oldProps = this.props;
this.props = { ...customProps, ...this.props };
try {
return kbvRender.apply(this, arguments);
} finally {
this.props = oldProps;
}
};
};