ReactRef

@native @JSType
trait ReactRef[T] extends Object

Non-mutable ref. Object returned from createRef() and some variants of useRef hook. It's typically either js component or a DOM element, both of which are js.Objects. You only use this type with the React.createRef() machinery. Use this instead of a string or ref callback. Introduced in 16.3. useRef uses a slightly different flavor of current. The current value is immutable.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

Extension method from react

If needed to satisfy API constraints, convert to a mutable ref whose current value can be changed.

If needed to satisfy API constraints, convert to a mutable ref whose current value can be changed.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object

Concrete fields

val current: T | Null

See react.syntax for syntax support on handling E|Null e.g. myref.current.toNonNullOption.

See react.syntax for syntax support on handling E|Null e.g. myref.current.toNonNullOption.