prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

Add DocumentReference field on my firestore document #1116

Closed nsantosdaveiga closed 3 years ago

nsantosdaveiga commented 3 years ago

Do you want to request a feature or report a bug?
bug

What is the current behavior?

RangeError: Maximum call stack size exceeded. at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 at [native code]:null in flushedQueue at [native code]:null in invokeCallbackAndReturnFlushedQueue

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.

I am using redux toolkit on a react native expo project.

When I add a reference field on a document this error appear

What is the expected behavior?

I can use this field with no error

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

"expo": "^41.0.0",
"react": "16.13.1",
"react-redux": "^7.2.3",
"react-redux-firebase": "^3.10.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"@reduxjs/toolkit": "^1.5.0",
nsantosdaveiga commented 3 years ago

I used this configuration:

export default configureStore({
  reducer: {
    ...,
    firebase: firebaseReducer,
    firestore: firestoreReducer,
  },
  middleware: getDefaultMiddleware =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: [
          // just ignore every redux-firebase and react-redux-firebase action type
          ...Object.keys(rfConstants.actionTypes).map(
            (type) => `${rfConstants.actionsPrefix}/${type}`
          ),
          ...Object.keys(rrfActionTypes).map(
            (type) => `@@reactReduxFirebase/${type}`
          ),
          ...Object.keys(rfActionTypes).map(
            (type) => `@@reduxFirestore/${type}`
          ),
        ],
        ignoredPaths: ['firebase', 'firestore', 'firestore.ordered', 'firestore.ordered.[YOUR_COLLECTION]'],
      },
      immutableCheck: {
        ignoredPaths: ['firestore', 'firestore.ordered', 'firestore.ordered.[YOUR_COLLECTION]'],
      },
      thunk: {
        extraArgument: {
          getFirebase,
          getFirestore,
        },
      },
    }),
})