object Profiler
The Profiler measures how often a React application renders and what the "cost" of rendering is. Its purpose is to help identify parts of an application that are slow and may benefit from optimizations such as memoization.
See https://reactjs.org/docs/profiler.html
- Since
React 16.9.0 / scalajs-react 1.7.0
- Alphabetic
- By Inheritance
- Profiler
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class Interaction(id: Int, name: String, timestamp: Double) extends Product with Serializable
-
final
case class
OnRenderData(id: String, phase: String, actualDurationMs: Double, baseDurationMs: Double, startTime: Double, commitTime: Double, rawInteractions: Iterable[raw.Interaction]) extends Product with Serializable
Data returned by the Profiler.
Data returned by the Profiler.
- id
The id prop of the Profiler tree that has just committed. This can be used to identify which part of the tree was committed if you are using multiple profilers.
- phase
Identifies whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks.
- actualDurationMs
Time spent rendering the Profiler and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. React.memo, useMemo, shouldComponentUpdate). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.
- baseDurationMs
Duration of the most recent render time for each individual component within the Profiler tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization).
- startTime
Timestamp when React began rendering the current update.
- commitTime
Timestamp when React committed the current update. This value is shared between all profilers in a commit, enabling them to be grouped if desirable.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(id: String, onRender: (OnRenderData) ⇒ Callback)(children: vdom.PackageBase.VdomNode): vdom.PackageBase.VdomElement
The Profiler measures how often a React application renders and what the "cost" of rendering is.
The Profiler measures how often a React application renders and what the "cost" of rendering is. Its purpose is to help identify parts of an application that are slow and may benefit from optimizations such as memoization.
See https://reactjs.org/docs/profiler.html
- children
Use
React.Fragmentto group multiple children.
- Since
React 16.9.0 / scalajs-react 1.7.0
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unstable_trace[A](name: String)(body: ⇒ A): A
CAUTION: Unstable API.
CAUTION: Unstable API. React may modify or remove this method without notice or deprecation and so might scalajs-react.
Traces a new interaction (by appending to the existing set of interactions). The callback function will be executed and its return value will be returned to the caller. Any code run within that callback will be attributed to that interaction. Calls to unstable_wrap() will schedule async work within the same zone.
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object Interaction extends Serializable
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.