小编ren*_*dom的帖子

react-navigation:检测屏幕,tabbar是否激活/出现/聚焦/模糊

当我想在屏幕打开时做一些动作时,我把它们放在componentDidMount中.例如,我可以获取一些数据.

像这样.

componentDidMount() {
  this.updateData();
}
Run Code Online (Sandbox Code Playgroud)

但是反应导航componentDidMount只在用户第一次打开屏幕时出现一次,如果以后用户再次打开此页面则不会触发componentDidMount.

检测页面(屏幕)何时被激活并执行操作的正确方法是什么?

onfocus viewdidappear viewwillappear react-native react-navigation

30
推荐指数
4
解决办法
2万
查看次数

OAuth 同意屏幕验证 - 符合域验证要求

我的 OAuth 同意屏幕验证向我显示了此消息

Comply with domain verification requirements
Ensure your application's domains have completed the Search Console verification process
Run Code Online (Sandbox Code Playgroud)

但在我的授权域中,有像 **.chromiumapp.org 或 *.extensions.allizom.org/ 这样的域,我无法验证其所有权。

google-cloud-platform

13
推荐指数
3
解决办法
2万
查看次数

Firestore:多个条件where子句

例如,我的书籍列表中有动态过滤器,我可以设置特定的颜色,作者和类别.此过滤器可以一次设置多种颜色和多个类别.

   Book > Red, Blue > Adventure, Detective.
Run Code Online (Sandbox Code Playgroud)

如何有条件地添加"where"?

  firebase
    .firestore()
    .collection("book")
    .where("category", "==", )
    .where("color", "==", )
    .where("author", "==", )

    .orderBy("date")
    .get()
    .then(querySnapshot => {...
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-firestore

12
推荐指数
4
解决办法
8554
查看次数

Firebase:创建文档时存储服务器时间戳

当我使用这段代码时:

firestore().collection("item").add({...item, created: firebase.database.ServerValue.TIMESTAMP})
Run Code Online (Sandbox Code Playgroud)

它创建条目{".sv" : "timestamp"}< - 实际单词"timestamp"

firebase google-cloud-firestore

10
推荐指数
3
解决办法
1万
查看次数

将颜色变量导入我的样式

我想用我的颜色变量创建文件,然后将此文件导入我的样式.

button: {
 color: primarycolor
 background: primarybackground
}
Run Code Online (Sandbox Code Playgroud)

所以我只能在一个地方改变颜色.

react-native

8
推荐指数
2
解决办法
7575
查看次数

Firebase:使用async/await进行交易

我正在尝试使用async/await与事务.但是获取错误"Argument"updateFunction"不是一个有效的函数."

var docRef = admin.firestore().collection("docs").doc(docId);
let transaction = admin.firestore().runTransaction();
let doc = await transaction.get(docRef);

if (!doc.exists) {throw ("doc not found");}
var newLikes = doc.data().likes + 1;

await transaction.update(docRef, { likes: newLikes });
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-firestore

7
推荐指数
3
解决办法
3733
查看次数

反应原生链接挂起"资产已成功链接到您的项目"

运行 react-native链接后

Scanning folders for symlinks in /Users/appfolder/node_modules (12ms)
rnpm-install info Platform 'ios' module react-native-firebase is already linked
rnpm-install info Linking react-native-firebase android dependency
rnpm-install info Platform 'android' module react-native-firebase has been successfully linked
rnpm-install info Platform 'ios' module react-native-image-crop-picker is already linked
rnpm-install info Linking react-native-image-crop-picker android dependency
rnpm-install info Platform 'android' module react-native-image-crop-picker has been successfully linked
rnpm-install info Linking react-native-localization ios dependency
rnpm-install info Platform 'ios' module react-native-localization has been successfully linked
rnpm-install info Linking react-native-localization android …
Run Code Online (Sandbox Code Playgroud)

react-native

7
推荐指数
0
解决办法
622
查看次数

react-native:相对于设备而不是父元素定位子元素

我<Child />里面有一个子元素,<Parent height="40"/>我想相对于设备视图区域而不是父元素绝对定位子元素。

示例布局

<device height="1000">

 <header height="500">
 <ScrollView />
 <parent height=40">
  <child height="300" top="150" />
 </parent>


</device>
Run Code Online (Sandbox Code Playgroud)

position="absolute" 是相对于父母的,没有 position="fixed"

react-native

5
推荐指数
1
解决办法
1849
查看次数

react-native:最终形式关注下一个领域

我无法将我的下一个领域集中在最终形式和本机和功能组件上。关于这种情况,大约有 0 个文档。

<Field
  component={TextField}
  name="title"
  returnKeyType={"next"}
  blurOnSubmit={false}
  onSubmitEditing={() => {
    _descriptionFieldRef.current.focus();
  }}
/>
Run Code Online (Sandbox Code Playgroud)

reactjs react-native final-form react-final-form

5
推荐指数
0
解决办法
616
查看次数

Safari Web 扩展 使用 Google 登录

Safari 现在可以使用网络扩展。

但不支持browser.identityor 。chrome.identity所以launchWebAuthFlow不工作。

在文档中他们只是说。

身份 不支持。在新选项卡中启动 OAuth 流程。

我该怎么做?有例子吗?

google-chrome-extension oauth-2.0 safari-web-extension

5
推荐指数
1
解决办法
326
查看次数