问题标签 [refs]

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 投票
1 回答
47 浏览

git - 获取已合并 PR 的合并结果

对于编号为 1 的 PR,GitHub 会自动创建一个 refrefs/pulls/1/headrefs/pulls/1/merge. 后者包含合并的结果,对于例如 CI 尤其有用(因为您要测试的实际上是合并的结果)。

合并 PR 后,refs/pulls/<number>/merge不再可用(我想是因为 PR 不再可合并)。目前我想对不久前合并的版本进行测试。有没有一种简单的方法可以访问合并 PR 的结果,只给 PR 编号?

0 投票
1 回答
28 浏览

git - Failed to push refs on a multi-user GIT Server

I am using GIT for versioning for me and my co-worker, and since the beginning I am running into an error that randomly effects either me or my co-worker.

We have two different users that push/pull to our Git-Server. Both are members of the same group gitusers.

From time to time (not all the time), if one of us pushes his changes to the server, the other gets an: ERROR: failed to push some ref to '' Changes were of course pulled before.

If found out that the permission for .git/refs/HEADS/[PROJECT_NAME] changed from rw-rw-r to rw-r-r so readonly for other group members. Owner is the last user who successfully pushed to the server.

I don't understand why. Especially because it does not happen all the time.

Can someone offer any advice?

screenshot

0 投票
1 回答
512 浏览

xcode - 如何通过动态使用 refs 在 react native 中应用 css 属性

这是我的实例,我需要获取登录 div 并使用 refs 隐藏它如何实现?

0 投票
1 回答
1511 浏览

javascript - React.js insert into ref of another component

I'm starting to learn react.js, and I've face a situation that I can't get an answer.

This is my components structure(this is just to show hierarchy):

Where ItemList and ItemForm are siblings, chilren of ItemContainer. And ItemSingle is a child from ItemList.

On each ItemSingle I have a "edit" button, that should update the form with its content, but I'm not able to send from ItemSingle to ItemForm.refs.

This is what I've tried

ItemSingle Component:

ItemForm Component:

And this is the error I got on ItemSingle line number 4:

0 投票
1 回答
53 浏览

oracle - 从对象表中选择并允许 Ref(null) 结果

我想运行一个函数,该函数将从对象表中选择一个引用到一个属性中,如果表返回 null,则该属性设置为 null。为了实现这一点,我尝试了代码。

但这在 where 找不到匹配项的任何时候都会失败。我有以下内容

但我希望有一个更好的解决方案,不涉及太多冗余。

有什么建议么?

0 投票
1 回答
43 浏览

reactjs - 为什么不能封闭 refs?

我正在尝试使用这样的反应组件:

为什么我不能this.refs.item在我的代码中使用?
PS我用另一种方式解决了这个问题,但这个问题让我感兴趣。

0 投票
1 回答
501 浏览

xsd - 将模式值作为参数或参考动态传递

我想使用模式强制执行我的 ID/IDRefs。下面的代码完美运行,但我想对其进行一些优化,因为除了模式中的前 3 个字符之外,所有不同的类型都是相同的。是否可以有一个泛型类型,它将前缀(SEG,ITI,...)作为参数?

0 投票
2 回答
688 浏览

reactjs - React 0.14 - 通过 findDOMNode 使用 refs

我正在尝试使用 refs 在单击按钮时访问输入字段。我编写的语法在 ComponentDidMount 中运行良好,但在单击按钮时会出现以下错误。未捕获的类型错误:无法读取 null 的属性“引用”。

0 投票
2 回答
2058 浏览

javascript - 如何在 React js 中正确使用 Refs?

我对 react refs 的工作方式感到困惑。我的问题是,每当我更改输入选择值时,update_cart都会调用函数。

然后,我使用相关 API 调用操作来设置值。

但是,目前,每当我更改值时,整个组件都会刷新并且 refs 值设置为未定义。

我究竟做错了什么?

请注意,我只包含了相关代码。

0 投票
2 回答
4160 浏览

javascript - 反应获取所有儿童参考

我有一个呈现动态子级的组件,这些子级中的每一个都需要分配给它们的 ref,例如ref={'childID' + index}

一旦孩子们加载完毕,我就需要一种方法来循环孩子们并获得他们的参考。

有什么办法吗?