Skip to Content
ARCUI

State ownership

Keep semantic application state in React and frame-level visual state in Reanimated.

ARCUI deliberately separates semantic/structural state from continuous visual state.

That boundary is the most important rule in the library.

meaning / business behavior / accessibility -> React
continuous visual progress                  -> Reanimated SharedValues
frame-level animation                       -> UI thread where practical

Semantic state belongs to React

Use React or the application's state layer for values that affect meaning, structure, accessibility, persistence, or business behavior:

  • checked and selected values;
  • form values and validation;
  • expanded/collapsed state;
  • active tabs;
  • loading and disabled state;
  • Modal visibility;
  • submitted, persisted, or announced data.
const [checked, setChecked] = useState(false);

<Checkbox checked={checked} onCheckedChange={setChecked}>
  Remember this device
</Checkbox>;

The callback requests a change. The owner commits the new semantic value.

Visual frame state belongs to Reanimated

Press feedback, gesture position, progress interpolation, theme interpolation, thumb movement, and transient layout transitions may update every frame.

Those values should not be mirrored into React state simply to drive animation.

ARCUI uses SharedValues internally for that work where practical.

Controlled contracts are intentional

Controlled ARCUI state makes the application source of truth explicit.

Common examples include:

AreaOwnership
Checkbox, Radio, Toggle, selectable ChipControlled selection state.
SelectionGroupControlled single or multiple group value.
Accordion / AccordionGroupControlled expanded value(s).
SelectControlled selected value(s).
SliderControlled single/range semantic value.
TabBar / TabNavigationControlled selected tab.
InputNumber, InputOTPControlled semantic value.
ModalControlled visible.

Text-input primitives preserve normal React Native ownership where useful: Input, InputArea, and InputPassword can use controlled or uncontrolled text-input patterns, but a mounted input should not switch ownership mode.

Standalone vs grouped selection

Selection-aware controls model mutually exclusive ownership modes.

Standalone:

<Checkbox
  checked={checked}
  onCheckedChange={setChecked}
>
  Email
</Checkbox>

Grouped:

<SelectionGroup
  multiple
  values={values}
  onValuesChange={setValues}
>
  <Checkbox value="email">Email</Checkbox>
  <Checkbox value="push">Push</Checkbox>
</SelectionGroup>

Do not combine standalone checked ownership with grouped value ownership on the same selection-aware control.

SelectionGroup →

Live change vs commit

Some interactions need both immediate semantic updates and a clear end-of-interaction boundary.

Slider exposes this explicitly:

<Slider
  value={volume}
  onValueChange={setVolume}
  onValueCommit={persistVolume}
/>

Use the live callback when the UI truly needs live semantic updates. Use the commit callback for expensive persistence, analytics, network work, or other logic that belongs after the interaction finishes.

Slider →

Accessibility follows semantic state

Assistive technology should receive the real React-owned state, not an intermediate animation progress value.

A Toggle thumb may be halfway through a visual transition, but its accessible checked state follows the controlled boolean.

Accessibility →

SharedValue rule for custom extensions

ARCUI consistently uses Reanimated .value where SharedValues belong:

  • worklets;
  • animated hooks;
  • effects;
  • gestures and event handlers;
  • lifecycle callbacks.

Do not read or write SharedValue .value during normal React render.

Motion →

On this page