remold/ui

useRemold

Animate a state change you make from an event handler.

Usage

const { ref, animate } = useRemold();

<ul ref={ref}>{items.map(renderItem)}</ul>
<button onClick={() => animate(() => setSort('price'))}>Sort by price</button>

Without React, transition takes the element and the change, and returns the same Transition. The options below are the same.

Options

Prop

Type

Returns

Prop

Type

On this page