Top "Ref" questions

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

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. …

reactjs ref refs
How to rerender when refs change

Code: import DrawControl from "react-mapbox-gl-draw"; export default function MapboxGLMap() { let drawControl = null return( <DrawControl ref={DrawControl => {drawControl = DrawControl}}/&…

javascript reactjs ref
Sencha Touch 2.1 Get View by Ref in Controller

When trying to programatically push a view into the main navigation view on the viewport, I get the following error: …

controller ref sencha-touch-2.1
What would be a "Hello, World!" example for "std::ref"?

Can somebody give a simple example which demonstrates the functionality of std::ref? I mean an example in which some …

c++ c++11 std ref
Workaround for optional ref parameters in C#

I'm trying to write a method that takes references to boolean flags and modify them. The booleans are all declared …

c# c#-3.0 optional-parameters ref
How to save a ref variable for later use?

So this works.. public MyClass(ref Apple apple) { apple = new Apple("Macintosh"); // Works fine } But is it possible to do …

c# reference ref
How to use Material-UI Select with React Hook Form

I've built a form in React using MUI and React Hook Form. I'm trying to create a custom TextField element …

reactjs material-ui ref react-hook-form
Example of practical of "ref" use

I am struggling how to use "ref" (to pass argument by reference) in real app. I would like to have …

c# ref
Create Ref using React.createRef without using constructor in React?

Basically, I have used constructor in React for only 3 reasons - 1. To initialize state like - class App extends React.…

javascript reactjs ref
React.forwardRef Causes Error with Styled Component

I am running React 16.3.1 and Styled Components 3.2.5 currently and am hitting an issue trying to use React.forwardRef. I have …

javascript reactjs ref styled-components forward-reference