Top "Ref" questions

The ref keyword causes an argument to be passed by reference, not by value.

Alternative to using ref in foreach?

I have a modifying method with a signature like private bool Modify(ref MyClass obj); that will make modifications to …

c# foreach ref
Understanding: Warning: Function components cannot be given refs

I know that refs are used to access DOM elements directly without altering the state. I read that it's not …

javascript reactjs ref react-forwardref
Perl Array References and avoiding "Type of arg 1 to keys must be hash" error

I have a scalar $subscribers that could be undef, reference to a HASH, or reference to an ARRAY. I have …

arrays perl hash ref perl-data-structures
scrollIntoView using React refs

We are trying to scroll to a specific component when the user closes another component. Our example is very similar …

javascript reactjs dom ref react-dom
C# 'ref' keyword, performance

If you have a Bitmap object that needs to be passed to numerous methods (about 10), and finally to an event …

c# performance ref
What are the 'ref' and 'sealed' keywords in C++?

I've just seen some (presumably) C++ code which sports two "keywords" unknown to me (I'm assuming keywords but, since I …

c++ ref sealed
How to check that Excel cell contains REF! error in VBA

I found many discussions on how to do it in Excel, but my goal is to capture REF! error in …

vba ref
Using 'ref' on React Styled Components is not working

I am having difficulty using refs with Styled Components. When I try to access them in my class methods like …

javascript reactjs dom ref styled-components
How can I use ref in TextField

my original code was like this: handleClick() { var name = this.refs.name.value; var description = this.refs.description.value } render () { …

material-ui textfield ref
ref for variables not parameters in functions

Suppose I have a Person class and have the following: Person A = new Person("Tom"); Person B = A; Is there …

c# ref