ShineJS

useShine Hook

Imperative React hook API for advanced ShineJS update flows.

Default React API

For most React apps, prefer Shine. Use useShine when you need direct imperative control (update, direct instance access, custom ref lifecycle handling).

Signature

useShine(
  ref: RefObject<HTMLElement | null>,
  config?: ShineOptions,
): { shine: Shine | null; update: (newConfig: ShineOptions) => void }

Parameters

  • ref: target element reference.
  • config: optional initial options.

Returns

  • shine: underlying instance (null pre-mount).
  • update: method to apply runtime options.

Notes

  • Automatically constructs and destroys a single Shine instance with component lifecycle.
  • Applies config changes via diffed update(...) calls.

On this page