问题标签 [react-redux-firebase]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
817 浏览

reactjs - React/Redux/Firebase 延迟加载

我使用 react-redux-firebase firebaseConnect 从 firebase 实时数据库加载帖子。

问题是它一次加载所有帖子,当我想要延迟加载(无限滚动)时。

0 投票
3 回答
2075 浏览

reactjs - 如何使用 v3.0.0 找到 firebaseAuthIsReady?

使用 v3.0.0 的 react-redux-firebase 中的替代方法是什么来确定身份验证是否已准备好 - 首次渲染?在这种情况下,问题是商店不包含 firebaseAuthIsReady 还是我遗漏了什么?

0 投票
2 回答
242 浏览

react-native - 触发 Firebase 'child_removed' 侦听器后,从 redux 状态中删除嵌套子级

我的 redux 状态看起来像这样(它与 Firebase 同步)。

我想删除用户 zQiGXvcUGmRSKUdr719621QleUw2

这是我的动作创造者

最后这是我的减速器

为了从redux中删除snapshot.key引用的用户,我从reducer返回什么?非常感谢帮助

0 投票
2 回答
779 浏览

redux - 使用 react-redux-firebase 将组件连接到 redux 时选择 firestore 子集合

我在我的 react-native 移动应用程序中使用带有屏幕react-redux-firebase的中间件。fireStoreConnect()在将组件连接到 redux 商店时,我想指定我连接到的 firestore 子集合,这取决于正在导航应用程序的用户。

我应该如何指定集合firestoreConnect?用户 ID 在 redux 存储中。

MWE:

0 投票
2 回答
313 浏览

javascript - Firestore 错误 - 内部断言失败:未知错误类型:符号

我用 React 开发了使用 firestore 的 web 应用程序。

我尝试使用作为 js 对象提供的数据创建新文档:

有时它可以毫无问题地工作,但在大约 50% 的测试中,我得到一个 firebase 错误:“FIRESTORE (5.5.0) INTERNAL ASSERTION FAILED: Unknown wrong type: symbol”

我使用这些扩展来处理 Firestore:

"redux-firestore": "^0.5.8" "react-redux-firebase": "^2.2.6" "firebase": "^5.8.4"

感谢您为解决此问题提供的任何帮助!

0 投票
1 回答
124 浏览

reactjs - Logout error with conditional collection on React Firebase app

On my Navbar.js component I have a conditional element that only displays if you are an siteAdministrator. If the condition is met you are shown the link and you can navigate to the page. However, when I logout I get thrown an error:

Uncaught FirebaseError: Function Query.where() requires a valid third argument, but it was undefined.

What I think is happening is that the system is logging out the user and while the rest of code in export default is finishing it is noticing that props.auth.uid does not exists. Are there any other thoughts as to what is happening and could someone help me fix it. Thanks in advance...

0 投票
1 回答
140 浏览

reactjs - 使用 redux 从子组件更新根组件的属性

我有两个组件,即包含数据列表的根组件。数据从firebase显示。第二个组件是帮助选择日期的 DateRangepicker,因此我们可以过滤根的组件数据。

0 投票
2 回答
922 浏览

reactjs - 如何在 mapStateToProps 中转换异步数据?

  • 我正在使用 firestoreConnect() 将来自 firestore 的数据与 redux 同步。

  • 我通过 state.firestore.ordered 从 firestore 获取了一组员工对象

  • 员工的形状是这样的:

    /li>
  • 在 mapStateToProps 中,我需要先转换此数据的形状,然后再将其返回并通过 props 将其传递给组件

    /li>
  • 这导致:TypeError:无法读取未定义的属性“地图”

  • 我知道这是因为获取数据是异步的,并且在我映射 state.firestore.ordered.employees 时,employees 属性 === undefined 是不可迭代的

所以,我的问题是你如何使用异步数据进行这种数据转换?有没有办法暂停 mapStateToProps 的执行并等待数据在映射之前返回?

如果这个问题难以理解,请提前致谢和抱歉,这是我第一次发帖。

0 投票
1 回答
162 浏览

reactjs - 如何仅在 firebaseAuthIsReady 时返回组件

我决定制作组件“reduxStore”(它是我项目中的顶级 hoc),我正在创建一个全局存储并进行一些配置,包括 firebase 中间件。

这是组件的代码:

如您所见,reduxStore 将我的应用程序包装在 index.js 中:

问题是,如何在 reduxStore 组件内应用store.firebaseAuthIsReady,因为如果用户登录或未登录,我想在 App 组件内渲染 Auth 或 Layout 组件。如何正确执行此操作?

0 投票
1 回答
2166 浏览

firebase - 在 firebase 中使用 redux 更新用户个人资料信息

我正在尝试在我的 React 应用程序中使用 Redux 从我的 React 组件更新我的 Firebase 数据库中的用户配置文件。

这是我的组件:

组件正确显示当前用户信息。

这是我设置的操作:

当我记录输入时,profile.firstName我得到输入的数据。

还有我的减速机:

知道我在这里缺少什么吗?