Packages

p

react

package react

A scala.js react facaded in the spirit of ReasonReact.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. react
  2. When
  3. React
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package bootstrap
  2. package native
  3. package vdom

    Simple vdom.

    Simple vdom. There are two styles, one with list of attributes like many other scalajs react bindings. The preferred approach is using typed traits (subclasses of js.Objects) so that properties presence/absence can be checked.

Type Members

  1. trait AllInstances extends jshelpers.AllInstances with ValueConverters with ValueInstances
  2. trait AllSyntax extends ComponentSyntax with ValueSyntax with JsDynamicSyntax with JsObjectSyntax with JsAnySyntax with OrNullSyntax with ScalaMappedSyntax with OptionSyntax with JsUndefOrSyntax with MiscOrSyntax with JsRefSyntax with JSPromiseSyntax with ContextSyntax with OrSyntax with JSArraySyntax
  3. type AllType = |[|[|[|[|[|[|[|[|[|[|[|[Boolean, Byte], Short], Float], String], Double], Int], Object], Dictionary[_]], Symbol], Array[Any]], Null], Unit]

    General purpose type that grabs AnyVal and some js types.

  4. trait Children extends Object
    Annotations
    @JSType() @native()
  5. trait ComponentSyntax extends AnyRef
  6. trait Concurrent extends Object
    Annotations
    @JSType() @native()
  7. trait ContextSyntax extends AnyRef
  8. trait DeferredValueConfig extends Object
    Annotations
    @JSType()
  9. type Dependencies = Array[AllType]

    Hook dependencies data structure.

    Hook dependencies data structure. Should this be scala.Any? The docs suggest otherwise.

  10. type Dispatch[A] = Function1[A, Unit]

    A js dispatch function for side effects.

    A js dispatch function for side effects. Used in useState.

  11. trait DynamicImport extends Object

    Opaque type.

    Opaque type.

    Annotations
    @JSType() @native()
  12. type DynamicImportThunk = Function0[Promise[DynamicImport]]

    The type of () => import("somecomponent") which is used exclusively for the argument to React.lazy.

  13. trait EffectArg extends Object

    Magnet pattern to create a friendly arg converter for effect hooks.

    Magnet pattern to create a friendly arg converter for effect hooks. As much as possible these need to be casts vs allocations.

    Annotations
    @JSType() @native()
  14. trait HasKey extends Object

    Known to contain a key.

    Known to contain a key.

    Annotations
    @JSType()
  15. trait HasStrKey extends Object

    With key but key is known to be a String which is the common scenario.

    With key but key is known to be a String which is the common scenario.

    Annotations
    @JSType()
  16. trait Hooks extends Object
    Annotations
    @JSType() @native()
  17. type ImportedJSComponent = |[|[ReactJSComponent, ReactJSFunctionComponent], ReactJSLazyComponent]

    All the types of components that can be imported from JS.

    All the types of components that can be imported from JS. These must be processed to be allowed to be used as Components in this facade. Keep in sync with ReactType.

  18. final case class JsRefOps[T](v: ReactRef[T]) extends Product with Serializable
  19. trait JsRefSyntax extends AnyRef
  20. type KeyType = |[String, Int]

    Very un-ergonomic, but this is what FB has.

  21. trait MaybeHasStrKey extends Object

    Optional key but no ref.

    Optional key but no ref. Key must be a string.

    Annotations
    @JSType()
  22. case class MemoizeLast[-T, +R](f: (T) => R, eq: (T, T) => Boolean = (a: T, b: T) => a == b) extends (T) => R with Product with Serializable

    Memoize the last value only.

    Memoize the last value only. Since its only 1 arg, use yourfunc _ tupled to tuple the arguments. Uses scala == for the test. js semantics for equality are very different. scala provids semantic equality unlike js. An optional eq can be used. In general, you will probably memoize js functions using the react hooks so may not need this memoization utility much.

    See also

    https://medium.com/musings-on-functional-programming/scala-optimizing-expensive-functions-with-memoization-c05b781ae826

  23. trait MutableRef[T] extends Object

    For use with useRef() hook which is slightly different than the mutable Ref.

    For use with useRef() hook which is slightly different than the mutable Ref. current is designed to be set directly or can be used on the ref attribute for a component. Since you can provide an initial value, if you want null to be valid, either use null directly or model it explicitly as T|Null to force client's to deal with the explict null value (otherwise they need to check for the null value directly).

    Annotations
    @JSType()
  24. trait MutableSource[T] extends Object

    Opaque type.

    Opaque type.

    Annotations
    @JSType() @native()
  25. type PropsChildren = Array[ReactElement]

    Children type.

  26. trait React extends AnyRef

    Scala-side access to JSReact APIs.

    Scala-side access to JSReact APIs. Some of these methods overlay the raw JS version to provide the convenience of using scala types as inputs and saving a few conversion nits.

    Some of the *N() hook functions like useCallback may be quite inefficient in their conversion from scala functions to js functions and back. Perhaps we need another parallel API function set with the js functions being assumed for those code bases that already have the js versions. Note that useCallback returns a js function so it can be used as a dependency.

  27. trait ReactChildren extends ReactElement
    Annotations
    @JSType() @native()
  28. trait ReactClass extends Object

    A js-object that is returned from create-react-class.

    A js-object that is returned from create-react-class. In reactjs a react class is a js object created using the "class" construct. This should really be ReactJSComponent but we keep this slightly different for those who care about such things.

    Annotations
    @JSType() @native()
  29. type ReactComponentType = |[|[|[|[|[|[ReactClass, ReactJSComponent], ReactJSFunctionComponent], ReactJSLazyComponent], ScalaJSFunctionComponent], ScalaJSFunctionComponent1], ScalaJSFunctionComponent1WithRef]

    Component type that can be used in HOCs.

  30. trait ReactContext[T] extends Object

    React's context object contains the consumer and provider "components".

    React's context object contains the consumer and provider "components".

    Annotations
    @JSType() @native()
  31. final class ReactContextOps2[T] extends AnyVal

    Removing only the "r" on the end may be confusing...

  32. trait ReactDOMElement extends ReactElement

    A standard HTML element that has been created using createElement.

    A standard HTML element that has been created using createElement. Props are optional of course. We use this tag it to show that it came from the standard DOM components vs a custom one.

    Annotations
    @JSType() @native()
  33. trait ReactElement extends ReactNode

    Output from react.createElement.

    Output from react.createElement. Subtype of ReactNode to indicate that the output came from createElement vs say, a string or number.

    Annotations
    @JSType() @native()
  34. type ReactElementTuple[P <: Object] = (Function1[P, ReactNode], P)

    A type for declaring an element using a tuple and an implicit conversion.

    A type for declaring an element using a tuple and an implicit conversion. An implicit can pick this up and convert it to a react element.

  35. type ReactFC[P <: Object] = Function1[P, ReactNode]

    A type used to drive type inference when declaring your component.

  36. type ReactFC0 = Function0[ReactNode]

    A type used to drive type inference when declaring your component.

  37. trait ReactJS extends Object with Concurrent
    Annotations
    @JSType() @native()
  38. trait ReactJSComponent extends Object

    This type is used only as a target for imported javascript authored components to "tag" a component type or created via other js-interop mechanisms such as redux integration.

    This type is used only as a target for imported javascript authored components to "tag" a component type or created via other js-interop mechanisms such as redux integration. By using a separate type, you must use then scalajs-react's API to create an element. You can use this to annotate a js function react component as well e.g. () => ReactNode.

    Annotations
    @JSType() @native()
  39. trait ReactJSFunctionComponent extends Object

    Import type target from js land that are functions and imported as such.

    Import type target from js land that are functions and imported as such. May or may not make a difference to have this typed separately. You could also import it as a jsFunctionN object.

    Annotations
    @JSType() @native()
  40. trait ReactJSLazyComponent extends Object with ReactJSComponent

    Not sure why I still have this.

    Not sure why I still have this. Probably should avoid.

    Annotations
    @JSType() @native()
  41. trait ReactJSProps extends Object

    Use this instead of ReactPropsJs.

    Use this instead of ReactPropsJs. But! you should probably should be using MaybeHasStrKey

    Annotations
    @JSType()
  42. trait ReactModule extends Object

    The module "object" that you import when you use react.

    The module "object" that you import when you use react.

    Annotations
    @JSType() @native()
  43. trait ReactNode extends Any

    Something that can be rendered in reactjs.

    Something that can be rendered in reactjs. react allows this to be quite flexible including strings, numbers, booleans in additon to classes or functions. Classes and functions are convered to a ReactNode by calling createElement on them however strings and numbers can be rendered directly.

    Annotations
    @JSType() @native()
  44. trait ReactNodeEncoder[A] extends AnyRef

    Encode a value to a ReactNode.

    Encode a value to a ReactNode. This can only be used for values that are themselves directly renderable because if you want to create a ReactNode from a component, you must call createElement with some props, and this typeclass does not have props anywhere!

  45. trait ReactPortal extends ReactElement

    For creating a portal in react-dom.

    For creating a portal in react-dom.

    Annotations
    @JSType() @native()
  46. trait ReactPropTypes extends Object
    Annotations
    @JSType() @native()
  47. trait ReactRef[T] extends Object

    Object returned from createRef().

    Object returned from createRef(). 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.

    Annotations
    @JSType() @native()
    To do

    Validate a null value is present if the ref is never set. typescript says so.

  48. type ReactType = |[|[|[|[|[|[|[ReactClass, String], ReactJSComponent], ReactJSFunctionComponent], ReactJSLazyComponent], ScalaJSFunctionComponent], ScalaJSFunctionComponent1], ScalaJSFunctionComponent1WithRef]

    Something that can be used in ReactJS.createElement().

    Something that can be used in ReactJS.createElement(). Given an object of this type, you must call createElement on it to create the element with optional props and children. If a parent is in a component, you use this type to represent it.

  49. type RectFCWithRef[P <: Object, T <: Any] = Function2[P, ReactRef[T], ReactNode]

    A component that takes a ref as the second argument.

  50. type Ref[E] = |[|[RefCb[E], ReactRef[E]], MutableRef[E]]

    Combine the callback and the createRef models.

    Combine the callback and the createRef models. Also include the newer hooks model.

  51. type RefCb[E] = Function1[|[E, Null], Unit]

    Callback for react ref with settable E.

  52. trait Requireable[T <: Any] extends Object
    Annotations
    @JSType() @native()
  53. type ScalaJSFunctionComponent = Function0[ReactNode]

    Pure JS functions defined in scala are also components.

  54. type ScalaJSFunctionComponent1 = Function1[_ <: Object, ReactNode]

    Pure JS functions defined in scala are also components.

  55. type ScalaJSFunctionComponent1WithRef = Function2[_ <: Object, _ <: Any, ReactNode]
  56. trait TransitionConfig extends Object
    Annotations
    @JSType()
  57. case class UseMutableSource[S, A]() extends Product with Serializable

    Instantiate this to sync types needed for both funcs.

  58. trait ValueConverters extends AnyRef

    Mostly obvious converters so you can have a variety of children types and have them convert to ReactNodes as needed.

    Mostly obvious converters so you can have a variety of children types and have them convert to ReactNodes as needed.

    Watch out for values that need to pass through 2 implicits since double implicit resolution is not supported by scala. So you may think that these conversions should apply but an UndefOr wrapper on the target type means either you need to use js.defined first and then these implicit conversions will apply automatically or you should use .toNode to convert the ReactNode value then let the general implicit create an UndefOr[T]. Just be mindful of implicit conversion rules in scala.

    To do

    Restructure as a typeclass using an "encoding" pattern, see the trait above :-).

  59. trait ValueInstances extends AnyRef
  60. final case class ValueOps[T](v: T) extends AnyVal with Product with Serializable

    Convert any scala object to a ReactNode via blah.toNode.

  61. trait ValueSyntax extends AnyRef

    Enable value.toNode syntax.

    Enable value.toNode syntax. ValueConverters enable direct conversion to ReactNode if you want to avoid the syntax and have magic.

  62. class WeakMap extends Object
    Annotations
    @JSType() @native() @JSGlobal()
  63. trait When extends AnyRef

    Conditional rendering support.

    Conditional rendering support. Uses by-name parameters to delay creating a react node if the condition idicates not to render.

  64. macro class deriveClassNames extends Annotation with StaticAnnotation

    Projection of a Styles object to a ClassNames trait.

    Projection of a Styles object to a ClassNames trait. This is specific to fabric styling but essentially ignores the type anyway so it could be used elsewhere. No check is performed to make sure you are annotating a Styles object. A styles object has only var members with types js.UndefOr[IStyle] and initial value js.undefined. The macro does not search superclasses (yet).

    Annotations
    @compileTimeOnly("Enable macros -Ymacro-annotations (2.13+) to expand macro annotation")
  65. macro class deriveForwardingTrait extends Annotation with StaticAnnotation

    "Exports" all defs and val/vars from a source object to another trait by creating static forwarders in the annotated trait.

    "Exports" all defs and val/vars from a source object to another trait by creating static forwarders in the annotated trait. This allows you to proxy methods imported from a js module into any trait easily. Only vals (or readers for vars) and defs are exported from the source.

    NOT FULLY TESTED YET!

    Annotations
    @compileTimeOnly("Enable macros -Ymacro-annotations (2.13+) to expand macro annotation")
  66. macro class jsenrich extends Annotation with StaticAnnotation

    Build/enhance companion object with various convenience methods.

    Build/enhance companion object with various convenience methods.

    Convenience methods include:

    1. apply method for properties in the immediate js.Object trait. This will overwrite any existing apply method.
    2. Extensions for changing individual properties: aTrait.withYourPropertyName("blah").
    3. Extension combineWith(that) to shallow combine two objects with that taking precedence.
    4. Extension .duplicate that shallow clones the object using js.Object.assign.

    These methods adds/creates new companion object with methods and implicit classes.

    WARNING: Does not handle trait parameters yet.

    Annotations
    @compileTimeOnly("Enable macros -Ymacro-annotations (2.13+) to expand macro annotation")

Deprecated Type Members

  1. type ReactClassInternal = ReactClass

    Alias for internal use.

    Alias for internal use.

    Deprecated
  2. trait ReactPropsJs extends Object

    Use these to mix into your traits to ensure you have a a key and ref to set.

    Use these to mix into your traits to ensure you have a a key and ref to set. For example, add this to a Props class so that you can specify a key when you create it. These are not special or used for tags, you can not use this trait and just define the key and/or ref in your Props trait directly.

    Annotations
    @JSType() @deprecated
    Deprecated

    (Since version 0.1.0) Use ReactJSProps

Value Members

  1. def arrayToElement[T <: ReactNode](arr: Array[T]): ReactNode

    Convenience.

    Convenience. Use implicits for syntax-based conversion.

  2. def callbackAsRef[E](f: (|[E, Null]) => Unit): Ref[E]
  3. def cloneElement(element: ReactElement, props: Object): ReactElement

    Clone a ReactElement and add new props.

    Clone a ReactElement and add new props. You should not use this if you can avoid it.

    Definition Classes
    React
  4. def copy[T <: Object](obj: |[Dynamic, Object]): T

    Shallow copy.

    Shallow copy. Should we call Object.assign directly? Faster?

  5. def createContext[T](defaultValue: T): ReactContext[T]
    Definition Classes
    React
  6. def createDOMElement(tag: String, props: |[Object, Dynamic])(children: ReactNode*): ReactDOMElement

    Create a DOM element using the string name e.g.

    Create a DOM element using the string name e.g. "div".

    Definition Classes
    React
  7. def createElement[P <: Object](component: ReactType, props: P, children: ReactNode*): ReactElement

    Create an element using the standard var args signature.

    Create an element using the standard var args signature.

    Definition Classes
    React
  8. def createElement[P <: Object](component: ReactType, props: P): ReactElement

    Create an element with some props.

    Create an element with some props. Children can be in the props.

    Definition Classes
    React
  9. def createElement0(tag: ReactType, props: |[Object, Dynamic]): ReactElement

    Create an element with props and 0 children.

    Create an element with props and 0 children.

    Definition Classes
    React
  10. def createElement1(tag: ReactType, props: |[Object, Dynamic], child: ReactNode): ReactElement

    Create an elemnt with 1 child only.

    Create an elemnt with 1 child only.

    Definition Classes
    React
  11. def createElementN(tag: ReactType)(children: ReactNode*): ReactElement

    Create an element without props but with children as a separate parameter.

    Create an element without props but with children as a separate parameter.

    Definition Classes
    React
  12. def createElementN(tag: ReactType, props: |[Object, Dynamic])(children: ReactNode*): ReactElement

    Create an element with props and children.

    Create an element with props and children.

    Definition Classes
    React
  13. def createFragment(key: Option[String], children: ReactNode*): ReactElement

    Create a react fragment.

    Create a react fragment. Fragments are created as an "element" with a specific tag (symbol or number if target does not support symbol) vs say, the string "div".

    Definition Classes
    React
  14. def createMutableSource[S](source: Any, getVersion: Function0[Any]): MutableSource[S]
    Definition Classes
    React
  15. def createRef[T](): ReactRef[T]

    Create a ReactRef.

    Create a ReactRef.

    Definition Classes
    React
  16. def deps(values: AllType*): Dependencies

    Create a dependencies array.

    Create a dependencies array. With on args, its a zero-length array.

  17. def emptyArray[T]: Array[T]

    Empty array.

    Empty array. Freshly allocated!

  18. def emptyChildren: Array[ReactNode]

    Allocate an empty child array.

    Allocate an empty child array. It's not shared like emptyChildrenVal

  19. val emptyChildrenVal: Array[ReactNode]

    Empty children value but non-empty array.

    Empty children value but non-empty array. Be careful as someone could mutate this global instance on you.

  20. val emptyDependencies: Dependencies

    Empty array which is different than undefinedDependencies.

    Empty array which is different than undefinedDependencies. Typically indicates mount/unmount hook processing.

  21. def extractChildren(item: UndefOr[Object]): Array[ReactNode]

    Given a js.Object (or subclass), find a "children" property and assume its an array of ReactNodes.

    Given a js.Object (or subclass), find a "children" property and assume its an array of ReactNodes. If not found, return an empty js array. This function is used for interop where your scala "make" method takes children as a separate parameter but your props (event JS friendly props) does not contain the children property--it's there if there are children on the js side. This is not needed in scalajs-react because the children are passed and managed explicitly.

    Definition Classes
    React
    Annotations
    @inline()
    To do

    Seems like this is an expensive call. Can we do better?

  22. def iterableToElement[T <: ReactNode](s: Iterable[T]): ReactNode

    Convenience.

    Convenience. Use implicits for automatic conversion.

  23. def jsEqual(a: Any, b: Any): Boolean

    Test equaliy with two js objects.

    Test equaliy with two js objects. Standard == in scala.js on 2 js objects (e.g. non-native traits) will not test in the same way that standard scala tests equality. Do not use this with react components (js objects) because react component objects may have circular data structures.

    You may want to look at some standard js equality libraries--there are many and are opimized in various ways. See https://github.com/FormidableLabs/react-fast-compare/blob/master/index.js in particular. This code is from https://stackoverflow.com/questions/38126349/how-to-deeply-compare-two-js-like-objects-in-scala-js.

  24. def jsdef[A](a: A): UndefOr[A]

    Shorted version of js.defined(blah)

    Shorted version of js.defined(blah)

    Annotations
    @inline()
  25. val jsundef: UndefOr[Nothing]

    Short version of js.undefined.

  26. def lazy(lazyComponent: DynamicImportThunk): ReactJSLazyComponent
    Definition Classes
    React
  27. def memo[P <: Object](fc: Function1[P, ReactNode], compare: Function2[UndefOr[P], UndefOr[P], Boolean]): Function1[P, ReactNode]

    Memoize with a function and a comparator.

    Memoize with a function and a comparator.

    Definition Classes
    React
  28. def memo[P <: Object](fc: Function1[P, ReactNode]): Function1[P, ReactNode]

    Memoize a function.

    Memoize a function.

    Definition Classes
    React
  29. def memoWith[P <: Object](compare: (UndefOr[P], UndefOr[P]) => Boolean)(f: (P) => ReactNode): ReactFC[P]

    Memo a function component.

  30. def memoWith[P <: Object](f: (P) => ReactNode): ReactFC[P]

    Memo a function component.

  31. def memoWith[P <: Object](compare: Function2[UndefOr[P], UndefOr[P], Boolean])(f: ReactFC[P]): ReactFC[P]

    Memo a function component.

  32. def memoWith[P <: Object](f: ReactFC[P]): ReactFC[P]

    Memo a function component.

  33. def merge[T <: Object](objs: |[|[|[UndefOr[Object], Dynamic], Object], Null]*): T

    Shallow merge objects into a new object and cast.

    Shallow merge objects into a new object and cast. Useful when merging props with data- attributes or component properties together. Last value wins. A syntax version of this function is available on js objects called combine. Creates and returns new object. Note, should we just call js.Object.assign here?

  34. def mergeJSObjects(objs: Dynamic*): Dynamic

    Merge js.Dynamics into a fresh object.

    Merge js.Dynamics into a fresh object. You should really use merge. https://stackoverflow.com/questions/36561209/is-it-possible-to-combine-two-js-dynamic-objects

  35. val noChildren: PropsChildren

    No children value.

  36. val noCleanUp: () => Unit

    Noop for effect callback.

  37. def noProps[T <: Object](): T

    Type inferring empty js object.

    Type inferring empty js object. A new object is created with each call.

  38. val noPropsVal: Object

    Constant val of a single, empty js.Object.

    Constant val of a single, empty js.Object. Use carefully since js allows mutation and this will be a shared instance. Prefer noProps().

  39. val nullDate: Date

    Type inference helper.

  40. val nullDouble: Double

    Type inference helper.

  41. val nullElement: ReactElement

    Return a "render nothing" element.

    Return a "render nothing" element. React ignores nulls during rendering.

  42. val nullFloat: Float

    Type inference helper.

  43. val nullInt: Int

    Type inference helper.

  44. val nullJSDate: Date

    Type inference helper.

  45. val nullJSObject: Object

    Type inference helper.

  46. val nullLong: Long

    Type inference helper.

  47. val nullNode: ReactNode

    null element, which does not render, cast to a ReactNode for better type inference.

  48. val nullString: String

    Type inference hepler.

  49. def refCB[E](f: (|[E, Null]) => Unit): Ref[E]

    Make Ref[E] from callback.

    Make Ref[E] from callback. See syntax for dealing with E|Null.

  50. def refCallback[E](f: (|[E, Null]) => Unit): RefCb[E]

    Make a callback.

    Make a callback. You don't need this but helps with type inference. There is some dedicated syntax support for E|Null handling.

  51. def refToJs[T](ref: ReactRef[T]): Dynamic

    Turn a ReactRef to a js.Dynamic so you can call "component" methods directly.

    Turn a ReactRef to a js.Dynamic so you can call "component" methods directly. Most notably "select", "value" or "focus()". I don't think this is right...

  52. def stringToElement(s: String): ReactNode

    String to react node.

    String to react node. Use implicits for automatic conversion and avoid calling this function.

  53. def toSafeOption[T <: Any](t: Any): Option[T]

    Return None if undefined or null -> None, otherwise return a Some.

    Return None if undefined or null -> None, otherwise return a Some. Syntax support makes this easier so you don't have to use this function.

  54. val undefinedDependencies: UndefOr[Dependencies]

    Undefined array typically indicates per render hook computation.

  55. def unsafeCreateElement(component: (Dynamic) => ReactNode, props: Dynamic): ReactElement
    Definition Classes
    React
  56. def unsafeCreateElement(component: () => ReactNode): ReactElement

    For creating quick ReactElements using js.Dynamic.

    For creating quick ReactElements using js.Dynamic. Input is a scala function taking a single props argument.

    Definition Classes
    React
  57. def unsafeDeps(values: Any*): Dependencies

    Escape hatch.

    Escape hatch. Create a dependencies array from *any* list of scala objects. Make sure you think about each value type in the list of dependencies. Use this inference helper to remind you to think about the types and scala-js interop.

  58. def useCallback[T](dependencies: AllType*)(callback: Function0[T]): Function0[T]
    Definition Classes
    React
  59. def useCallback1[A1, T](dependencies: AllType*)(callback: Function1[A1, T]): Function1[A1, T]
    Definition Classes
    React
  60. def useCallback1A[A1, T](dependencies: Dependencies)(callback: Function1[A1, T]): Function1[A1, T]
    Definition Classes
    React
  61. def useCallback2[A1, A2, T](dependencies: AllType*)(callback: Function2[A1, A2, T]): Function2[A1, A2, T]
    Definition Classes
    React
  62. def useCallback2A[A1, A2, T](dependencies: Dependencies)(callback: Function2[A1, A2, T]): Function2[A1, A2, T]
    Definition Classes
    React
  63. def useCallback3[A1, A2, A3, T](dependencies: AllType*)(callback: (A1, A2, A3) => T): Function3[A1, A2, A3, T]
    Definition Classes
    React
  64. def useCallback3A[A1, A2, A3, T](dependencies: Dependencies)(callback: (A1, A2, A3) => T): Function3[A1, A2, A3, T]
    Definition Classes
    React
  65. def useCallback4[A1, A2, A3, A4, T](dependencies: AllType*)(callback: (A1, A2, A3, A4) => T): Function4[A1, A2, A3, A4, T]
    Definition Classes
    React
  66. def useCallback4A[A1, A2, A3, A4, T](dependencies: Dependencies)(callback: (A1, A2, A3, A4) => T): Function4[A1, A2, A3, A4, T]
    Definition Classes
    React
  67. def useCallback5[A1, A2, A3, A4, A5, T](dependencies: AllType*)(callback: (A1, A2, A3, A4, A5) => T): Function5[A1, A2, A3, A4, A5, T]
    Definition Classes
    React
  68. def useCallback5[A1, A2, A3, A4, A5, T](dependencies: Dependencies)(callback: (A1, A2, A3, A4, A5) => T): Function5[A1, A2, A3, A4, A5, T]
    Definition Classes
    React
  69. def useCallbackA[T](dependencies: |[Dependencies, Unit])(callback: Function0[T]): Function0[T]
    Definition Classes
    React
  70. def useCallbackMounting[T](callback: Function0[T]): Function0[T]
    Definition Classes
    React
  71. def useCallbackMounting1[A1, T](callback: Function1[A1, T]): Function1[A1, T]
    Definition Classes
    React
  72. def useCallbackMounting2[A1, A2, T](callback: Function2[A1, A2, T]): Function2[A1, A2, T]
    Definition Classes
    React
  73. def useCallbackMounting3[A1, A2, A3, T](callback: Function3[A1, A2, A3, T]): Function3[A1, A2, A3, T]
    Definition Classes
    React
  74. def useCallbackMounting4[A1, A2, A3, A4, T](callback: Function4[A1, A2, A3, A4, T]): Function4[A1, A2, A3, A4, T]
    Definition Classes
    React
  75. def useCallbackMounting5[A1, A2, A3, A4, A5, T](callback: Function5[A1, A2, A3, A4, A5, T]): Function5[A1, A2, A3, A4, A5, T]
    Definition Classes
    React
  76. def useContext[T](context: ReactContext[T]): T
    Definition Classes
    React
  77. def useDebugValue[T](value: T, format: (T) => String): Unit
    Definition Classes
    React
  78. def useDebugValue[T](value: T): Unit
    Definition Classes
    React
  79. def useDeferredValue[T](value: T, t: Int): T
    Definition Classes
    React
  80. def useDeferredValue[T](value: T, config: DeferredValueConfig): T

    Use a deferred value.

    Use a deferred value. Config indicates how long the value is good for.

    Definition Classes
    React
  81. def useEffect(dependencies: AllType*)(didUpdate: EffectArg): Unit

    Effect is run when dependencies change.

    Effect is run when dependencies change.

    Definition Classes
    React
  82. def useEffectA(dependencies: Dependencies)(didUpdate: EffectArg): Unit

    Effect is run when dependencies change.

    Effect is run when dependencies change.

    Definition Classes
    React
  83. def useEffectAlways(didUpdate: EffectArg): Unit

    Effect is always run on render, which is probably too much.

    Effect is always run on render, which is probably too much.

    Definition Classes
    React
  84. def useEffectMounting(didUpdate: EffectArg): Unit

    Effect is run at mount/unmount time with an implied [] per the react docs.

    Effect is run at mount/unmount time with an implied [] per the react docs.

    Definition Classes
    React
  85. def useEffectUnmounting(thunk: Function0[Unit]): Unit
    Definition Classes
    React
  86. def useImperativeHandle[T, R <: Object](ref: MutableRef[T], thunk: () => R, dependencies: UndefOr[Dependencies]): Unit

    Expose imperative functions in R to refs.

    Expose imperative functions in R to refs.

    T

    Ref type

    R

    js object whose properties are functions. This is not enforced in the type.

    Definition Classes
    React
  87. def useLayoutEffect(didUpdate: EffectArg, dependencies: UndefOr[Dependencies]): Unit

    Run before browser updates the screen.

    Run before browser updates the screen. Kinda a "sync" effect.

    Definition Classes
    React
  88. def useMemo[T](dependencies: AllType*)(value: Function0[T]): T
    Definition Classes
    React
  89. def useMemo[T](value: () => T): T
    Definition Classes
    React
  90. def useMemoA[T](dependencies: Dependencies)(value: Function0[T]): T
    Definition Classes
    React
  91. def useMemoMounting[T](value: () => T): T
    Definition Classes
    React
  92. def useMutableSource[S, A](source: MutableSource[S], getSnapshot: Function1[S, A], subscribe: Function2[S, Function0[Unit], Function0[Unit]]): A

    subscribe 2nd arg is to be called whenever the value changes and is stable.

    subscribe 2nd arg is to be called whenever the value changes and is stable. Last is an unsubscribe for unmounting.

    Definition Classes
    React
  93. def useReducer[S, A, I](reducer: (S, A) => S, initialArg: I, init: (I) => S): (S, Dispatch[A])
    Definition Classes
    React
  94. def useReducer[S, A](reducer: (S, A) => S, initialState: S): (S, Dispatch[A])
    Definition Classes
    React
  95. def useRef[T](initialValue: T): MutableRef[T]

    Do not include Null in your type parameter as it added to MutableRef.current automatically.

    Do not include Null in your type parameter as it added to MutableRef.current automatically.

    Definition Classes
    React
  96. def useState[T](initial: () => T): (T, Function1[Function1[T, T], Unit])

    Initial value is a "lazy".

    Initial value is a "lazy". Setter is an updater. Use this one or useReducer.

    Definition Classes
    React
  97. def useStateDirect[T](initial: () => T): (T, Function1[T, Unit])

    Initial value is a "lazy".

    Initial value is a "lazy". Set new value directly. Don't use this.

    Definition Classes
    React
  98. def useStateStrict[T](initial: T): (T, Function1[Function1[T, T], Unit])

    Initial value is strict.

    Initial value is strict. Setter is an updater.

    Definition Classes
    React
  99. def useStateStrictDirect[T](initial: T): (T, Function1[T, Unit])

    Initial value is strict.

    Initial value is strict. Set new value directly. Don't use this.

    Definition Classes
    React
  100. def useTransition(t: Int): (Function1[Function0[Unit], Unit], Boolean)
    Definition Classes
    React
  101. def useTransition(config: TransitionConfig): (Function1[Function0[Unit], Unit], Boolean)
    Definition Classes
    React
  102. val version: String
    Definition Classes
    React
  103. def when[T](cond: UndefOr[T])(render: => ReactNode): ReactNode
    Definition Classes
    When
  104. def when(cond: Boolean)(render: => ReactNode): ReactNode

    Render something or return a null element.

    Render something or return a null element. Render is by name. Could just use fold.

    Definition Classes
    When
  105. def when[T <: Boolean](cond: Option[T])(render: => ReactNode)(implicit ev: =:=[T, Boolean]): ReactNode

    Render something or return a null element.

    Render something or return a null element. Render is by name. Could just use fold.

    Definition Classes
    When
  106. def when[T <: Boolean](cond: UndefOr[T])(render: => ReactNode)(implicit ev: =:=[T, Boolean]): ReactNode

    Render something or return a null element.

    Render something or return a null element. Render is by name. Could just use fold.

    Definition Classes
    When
  107. def whenNot[T](cond: UndefOr[T])(render: => ReactNode): ReactNode
    Definition Classes
    When
  108. def whenNot[T <: Boolean](cond: Option[T])(render: => ReactNode)(implicit ev: =:=[T, Boolean]): ReactNode

    Render something if not cond or return a null element.

    Render something if not cond or return a null element. Render is by name. Could also use fold.

    Definition Classes
    When
  109. def whenNot[T <: Boolean](cond: UndefOr[T])(render: => ReactNode)(implicit ev: =:=[T, Boolean]): ReactNode

    Render something if not cond or return a null element.

    Render something if not cond or return a null element. Render is by name. Could also use fold.

    Definition Classes
    When
  110. def whenNot(cond: Boolean)(render: => ReactNode): ReactNode

    Render something if notcond or return a null element.

    Render something if notcond or return a null element. Render is by name. Could also use fold.

    Definition Classes
    When
  111. def withKey[T <: Object](element: T, key: String): ReactElement

    Add a key.

    Add a key. Mutates input object directly because hey, this is javascript! This is definitely not correct. DO NOT USE!

  112. case object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  113. object EffectArg

    Implicit conversions that are very careful on the return value.

    Implicit conversions that are very careful on the return value. If the return value is a parameterless function, it is assumed to be the reactjs "after-effect" callback. Otherwise, the return value is discarded.

  114. object MemoizeLast extends Serializable
  115. object PropTypes extends Object with ReactPropTypes
    Annotations
    @native() @JSImport("prop-types", JSImport.Namespace)
  116. object Fragment

    Create a React.fragment element.

    Create a React.fragment element.

    Definition Classes
    React
  117. object StrictMode

    Strict element.

    Strict element. Wraps your root component typically.

    Definition Classes
    React
  118. object Suspense

    Catch a thrown js.Promise from the child.

    Catch a thrown js.Promise from the child. Show fallback until the promise is resolved.

    Definition Classes
    React
  119. object SuspenseList
    Definition Classes
    React
  120. object ReactNodeEncoder
  121. object ReactPublic extends Object with ReactModule

    A publically accessible react namespace import for those interop scenarios where you need this.

    A publically accessible react namespace import for those interop scenarios where you need this. There are no scala visible methods, etc.

    Annotations
    @native() @JSImport("react", JSImport.Namespace)
  122. object createClass
  123. object implicits extends AllSyntax with AllInstances
  124. object instances extends Instances

    Instances is the wrong concept here as these are not typeclass instances--but close enough as they are not syntax extensions "'element' converters" would be better similiar to JSConverters in scala.js.

  125. object syntax

Inherited from When

Inherited from React

Inherited from AnyRef

Inherited from Any

Ungrouped