diff --git a/lib/withOnyx.js b/lib/withOnyx.js index 12715ba2b..fc607b42b 100644 --- a/lib/withOnyx.js +++ b/lib/withOnyx.js @@ -143,13 +143,17 @@ export default function (mapOnyxToState) { // Remove any internal state properties used by withOnyx // that should not be passed to a wrapped component - const stateToPass = _.omit(this.state, 'loading'); + let stateToPass = _.omit(this.state, 'loading'); + stateToPass = _.omit(stateToPass, value => _.isNull(value)); + + // Remove any null values so that React replaces them with default props + const propsToPass = _.omit(this.props, value => _.isNull(value)); // Spreading props and state is necessary in an HOC where the data cannot be predicted return (