Questions tagged [refs]

Resilient File System

The Resilient File System (ReFS) is Microsoft's newest file system, designed to maximize data availability, scale efficiently to large data sets across diverse workloads, and provide data integrity by means of resiliency to corruption. It seeks to address an expanding set of storage scenarios and establish a foundation for future innovations.

162 questions
75
votes
5 answers

Git command to save a stash without modifying working tree?

I have been wanting to use a git command that saves a stash without modifying my working tree, as a lightweight backup that's safe from any git resets or whatever I might do to screw up my index. Basically the functional equivalent of "git stash…
Eliot
  • 5,450
  • 3
  • 32
  • 30
28
votes
3 answers

How do I list all remote refs?

Recently I created a PR on GitHub, but some tests were failing. And locally even more tests didn't pass. So I tried to figure out what's the issue. And the thing I found out is that Travis was testing the repo being at other commit I don't have. The…
x-yuri
  • 16,722
  • 15
  • 114
  • 161
28
votes
2 answers

Best Practice for globals in clojure, (refs vs alter-var-root)?

I've found myself using the following idiom lately in clojure code. (def *some-global-var* (ref {})) (defn get-global-var [] @*global-var*) (defn update-global-var [val] (dosync (ref-set *global-var* val))) Most of the time this isn't even…
Jeremy Wall
  • 23,907
  • 5
  • 55
  • 73
24
votes
3 answers

How I can use refs to change styling class in ReactJS?

I'm trying to change background of a div when color value changes. Here is my function which receives color value: ChangeColor(oColor) { this.props.ChangeColor(oColor); console.log("Refs: ", this.refs.colorPicker.className); }, Here is…
Muhammad Ateeq Azam
  • 1,009
  • 1
  • 12
  • 26
18
votes
2 answers

React: Losing ref values

I am using two components and I am using this pattern: child component should stay isolated as much it can - it is handling its own validation error. Parent component should check for errors which have dependencies between children. So, in my case:…
be-codified
  • 5,704
  • 18
  • 41
  • 65
15
votes
2 answers

React refs do not update between render

So I have this component var LineItemRowsWrapper = React.createClass({ current_lineitem_count: 0, getAjaxData: function(){ var lineitem_data = []; for(var i = 0; i < this.current_lineitem_count; i++){ var data =…
Charles Haro
  • 1,866
  • 3
  • 22
  • 36
14
votes
6 answers

Vue3 TypeError: template ref.value is null

how can I clean my console from the following error: TypeError: ref.value is null The error comes only with a resize event. Each time I resize the window, I render the chart. So the error message appears again and again. The documentation shows…
wittgenstein
  • 3,670
  • 7
  • 24
  • 41
14
votes
2 answers

React array of refs

i have read in a post on Stackoverflow question about refs that we can use something like the following code to assign an array of refs to different inputs like this: {this.Progress[0] =…
Elias Ghali
  • 823
  • 1
  • 13
  • 29
14
votes
2 answers

What's a bad practice with refs in React?

I'm getting to learn React. Some guys of different sites tells everyone that using refs is a bad practice (yep, using them at all). What's the real deal with it? Is it something bad that I will attach it to, for example, child component (so I can…
Krzysztof Borowy
  • 538
  • 1
  • 5
  • 21
13
votes
1 answer

Vue - using refs to focus an element target

When span class="before-click" is clicked, I want it hidden, and input class="after-click" show up instead. And the showed up input tag must be on focused! The problem is when I try to use $refs.afterClick to access that DOM and give it .focus(), an…
Arel Lin
  • 908
  • 2
  • 13
  • 24
12
votes
3 answers

Does git record history of branch heads?

Git branch heads and tags are pointers to commits, and these pointers can move either implicitly (after a commit) or explicitly (after a branch -m). Does Git record the history of the state of these pointers? I see at least two reasons for this: To…
Jake Lundy
  • 121
  • 1
  • 3
9
votes
1 answer

what is the alternative for ReactDOM.findDOMNode() as it is deprecated now?

I have an old code which is using findDOMNode(). Here is my code, where someComponent1 and Expand is already imported. Here I have some doubt the code I have written with findDOMNode() is working perfectly fine but as it is deprecated now I want to…
Bishal Jain
  • 189
  • 1
  • 2
  • 10
8
votes
1 answer

React-Three-Renderer refs not current in componentDidUpdate (MVCE included)

I'm using react-three-renderer (npm, github) for building a scene with three.js. I'm having a problem that I've boiled down to an MVCE. Refs aren't updating in the sequence I expect them to. First, here's the main code to look at: var React =…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
7
votes
2 answers

How do you get the height of a stateless functional component that's a child?

I'm trying to get the height of a stateless child component, so that I'm able to use its height within a parent Class, but I am getting the following error: Invariant Violation: Stateless function components cannot have refs. Simplified code Parent…
a7dc
  • 3,323
  • 7
  • 32
  • 50
6
votes
1 answer

Should multiple Clojure refs be read in a transaction for consistency?

This is a theoretical question motivated by my desire to understand Clojure's concurrency better. Let's say I'm writing boids. Assume each boid is a separate green thread mutating positions in a vector or refs representing a world grid. Think…
Thomas Heywood
  • 903
  • 2
  • 9
  • 18
1
2 3
10 11