Skip to content

Commit d27b631

Browse files
author
Scott Prue
committed
v3.0.0-alpha.6
* fix(firestoreConnect): fix invalid proptypes - [redux-firestore 165](prescottprue/redux-firestore#165)
1 parent 4f7e6a5 commit d27b631

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-redux-firebase",
3-
"version": "3.0.0-alpha.5",
3+
"version": "3.0.0-alpha.6",
44
"description": "Redux integration for Firebase. Comes with a Higher Order Components for use with React.",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/firestoreConnect.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { isEqual, some, filter } from 'lodash'
44
import hoistStatics from 'hoist-non-react-statics'
55
import { createCallable, wrapDisplayName } from './utils'
66
import ReduxFirestoreContext from './ReduxFirestoreContext'
7+
import ReactReduxFirebaseContext from './ReactReduxFirebaseContext'
78

89
/**
910
* @name createFirestoreConnect
@@ -87,27 +88,35 @@ export const createFirestoreConnect = (storeKey = 'store') => (
8788
}
8889

8990
FirestoreConnectWrapped.propTypes = {
90-
dispatch: PropTypes.func,
91+
dispatch: PropTypes.func.isRequired,
9192
firebase: PropTypes.object,
9293
firestore: PropTypes.object
9394
}
9495

9596
const HoistedComp = hoistStatics(FirestoreConnectWrapped, WrappedComponent)
9697

9798
const FirestoreConnect = props => (
98-
<ReduxFirestoreContext.Consumer>
99-
{firestore => <HoistedComp firestore={firestore} {...props} />}
100-
</ReduxFirestoreContext.Consumer>
99+
<ReactReduxFirebaseContext.Consumer>
100+
{firebase => (
101+
<ReduxFirestoreContext.Consumer>
102+
{firestore => (
103+
<HoistedComp
104+
firestore={firestore}
105+
firebase={firebase}
106+
dispatch={firebase.dispatch}
107+
{...props}
108+
/>
109+
)}
110+
</ReduxFirestoreContext.Consumer>
111+
)}
112+
</ReactReduxFirebaseContext.Consumer>
101113
)
114+
102115
FirestoreConnect.displayName = wrapDisplayName(
103116
WrappedComponent,
104117
'FirestoreConnect'
105118
)
106119

107-
FirestoreConnect.propTypes = {
108-
dispatch: PropTypes.func.isRequired
109-
}
110-
111120
return FirestoreConnect
112121
}
113122

0 commit comments

Comments
 (0)