React
import { Mulling } from 'mulling/react';
export function Status({ status }) { return <Mulling state={status} />;}- Props: every
mount()option is a prop (see Options), plusclassName,styleandid. - Pass-through:
data-*props, such asdata-testid, go on the wrapper element.aria-*props, such asaria-describedby, go on the loader’s labeled element, where screen readers read them. Uselabelrather thanaria-label. - Ref: gives you
update(),refresh()andelement. - Server rendering: it renders an empty, correctly sized
<span>on the server and mounts in the browser, so nothing shifts. - StrictMode: supported, including its double mount.
Smaller bundles
Section titled “Smaller bundles”mulling/react registers every loader. For the smallest bundle, use mulling/react/core and register the loaders you need with use(): 7.4 kB plus your loaders, not counting React.
import { Mulling } from 'mulling/react/core';import { use } from 'mulling/core';import { stateLoaders } from 'mulling/loaders';
use(...stateLoaders);