RootRef

io.github.nafg.scalajs.facades.mui.RootRef$
object RootRef extends Simple[VdomElement]

View original docs online: https://v4.mui.com/api/root-ref/

⚠️⚠️⚠️ If you want the DOM element of a Material-UI component check out FAQ: How can I access the DOM element? first.

This component uses findDOMNode which is deprecated in React.StrictMode.

Helper component to allow attaching a ref to a wrapped element to access the underlying DOM element.

It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801. For example:

import React from 'react';
import RootRef from '@material-ui/core/RootRef';

function MyComponent() {
 const domRef = React.useRef();

 React.useEffect(() => {
   console.log(domRef.current); // DOM node
 }, []);

 return (
   <RootRef rootRef={domRef}>
     <SomeChildComponent />
   </RootRef>
 );
}

Attributes

Graph
Supertypes
trait Simple[VdomElement]
trait ChildrenOf[VdomElement]
trait FacadeModule
trait FacadeModuleBase
class Object
trait Matchable
class Any
Self type
RootRef.type

Members list

Concise view

Type members

Classlikes

class Props extends WithChildren[VdomElement]

Attributes

Graph
Supertypes
trait WithChildren[VdomElement]
trait PropTypes
class Object
trait Matchable
class Any
object raw extends Object

Attributes

Graph
Supertypes
class Object
trait Any
class Object
trait Matchable
class Any
Self type
raw.type

Inherited classlikes

class ApplyChildren(settings: Setting*)

Attributes

Inherited from:
ChildrenOf
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited types

type Setting = () => Props

Attributes

Inherited from:
FacadeModule

Value members

Concrete methods

def asElementType: ElementType
override def mkProps: Props

Attributes

Definition Classes
FacadeModule

Inherited methods

def apply(settings: Setting*): ApplyChildren

Attributes

Inherited from:
Simple
def factory: Factory[Props]

Attributes

Inherited from:
FacadeModule

Inherited fields

lazy val facade: Facade

Attributes

Inherited from:
FacadeModuleBase