diff --git a/lib/KeyboardAwareHOC.js b/lib/KeyboardAwareHOC.js index 6efc646..9f79967 100644 --- a/lib/KeyboardAwareHOC.js +++ b/lib/KeyboardAwareHOC.js @@ -237,9 +237,9 @@ function KeyboardAwareHOC( }) } - componentWillReceiveProps(nextProps: KeyboardAwareHOCProps) { - if (nextProps.viewIsInsideTabBar !== this.props.viewIsInsideTabBar) { - const keyboardSpace: number = nextProps.viewIsInsideTabBar + componentDidUpdate(prevProps: KeyboardAwareHOCProps) { + if (this.props.viewIsInsideTabBar !== prevProps.viewIsInsideTabBar) { + const keyboardSpace: number = this.props.viewIsInsideTabBar ? _KAM_DEFAULT_TAB_BAR_HEIGHT : 0 if (this.state.keyboardSpace !== keyboardSpace) {