Skip to content

Commit 3a6df85

Browse files
committed
Made stripping of internal props based on the reserve props list
1 parent 44c64ee commit 3a6df85

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/firebaseConnect.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ export const createFirebaseConnect = (storeKey = 'store') => (
9292
}
9393

9494
render() {
95-
// Prevent internal refs from being passed down to children
96-
let props = { ...this.props }
97-
delete props._firebaseRef
98-
delete props._dispatch
95+
// Prevent reserved props from being passed down to children
96+
let props = Object.keys(this.props).reduce((acc, p) => {
97+
if (RESERVED_PROPS.indexOf(p) === -1) {
98+
acc[p] = this.props[p]
99+
}
100+
return acc
101+
}, {})
102+
99103
return <WrappedComponent {...props} />
100104
}
101105
}

0 commit comments

Comments
 (0)