Packages

package util

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Value Members

  1. object shift

    shift creates a new FunctionalComponent render step from provided body

    shift creates a new FunctionalComponent render step from provided body

    React hooks cannot be used with regular class-based components, and separating parts of state or using regular context API can be annoying. Shironeko Containers also have no place to specify an extra local state, which might be desirable in several scenarios.

    shift adds extra FunctionalComponent render layer, enabling use of hooks in both class-based components and Shironeko Container components

    def render(stateFromStore: State): ReactElement = shift {
      implicit val locale = Hooks.useContext(LocaleCtx)
      val (name, setName) = Hooks.useState("")
      val (age, setAge) = Hooks.useState(22)
    
      div(???)
    }

Ungrouped