Skip to content

Conversation

@prescottprue
Copy link
Owner

@prescottprue prescottprue commented Oct 29, 2017

Description

Potentially Breaking

  • store being passed as second argument of firebaseConnect (and firestoreConnect), which means any components using that second argument will break (most commonly used for getting uid). To access uid or other info from redux state, use store.getState() like so:
firebaseConnect(
  (props, store) => {
    const { firebase: { auth } } = store.getState()
    // be careful, listeners are not re-attached when auth state changes unless props change
    return [{ path: `todos/${auth.uid || ''}` }]
  }
)

More details are included in the migration guide.

Check List

If not relevant to pull request, check off as complete

  • All tests passing
  • Docs updated with any changes or examples if applicable
  • Added tests to ensure new feature(s) work properly

Relevant Issues

@codecov
Copy link

codecov bot commented Oct 29, 2017

Codecov Report

Merging #316 into v2.0.0 will decrease coverage by 0.51%.
The diff coverage is 95.52%.

@@            Coverage Diff            @@
##           v2.0.0    #316      +/-   ##
=========================================
- Coverage   84.11%   83.6%   -0.52%     
=========================================
  Files          22      22              
  Lines        2090    2122      +32     
  Branches      324     329       +5     
=========================================
+ Hits         1758    1774      +16     
- Misses        332     348      +16

@prescottprue prescottprue merged commit 2ec536c into v2.0.0 Oct 29, 2017
@prescottprue prescottprue deleted the v2.0.0-beta.14 branch October 29, 2017 10:42
prescottprue added a commit that referenced this pull request Oct 29, 2017
* fix(typings): Updated type definitions - #311
* fix(populate): dispatch for errors during profile population - #312
* feat(firebaseConnect): `store` is passed as second argument of `firebaseConnect` - #278
* feat(firestoreConnect): `store` is passed as second argument of `firestoreConnect`
* fix(query): `dispatchRemoveAction` is now `false` by default - prevents multiple state updates when calling `remove` if listener associated is attached

 * `store` being passed as second argument of `firebaseConnect` (and `firestoreConnect`), which means any components using that second argument will break (most commonly used for getting `uid`). To access `uid` or other info from redux state, use `store.getState()` like so:

```js
firebaseConnect(
  (props, store) => {
    const { firebase: { auth } } = store.getState()
    // be careful, listeners are not re-attached when auth state changes unless props change
    return [{ path: `todos/${auth.uid || ''}` }]
  }
)
```

More details are included in [the migration guide](http://docs.react-redux-firebase.com/history/v2.0.0/docs/v2-migration-guide.html).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants