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 practicalSemantic 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:
| Area | Ownership |
|---|---|
Checkbox, Radio, Toggle, selectable Chip | Controlled selection state. |
SelectionGroup | Controlled single or multiple group value. |
Accordion / AccordionGroup | Controlled expanded value(s). |
Select | Controlled selected value(s). |
Slider | Controlled single/range semantic value. |
TabBar / TabNavigation | Controlled selected tab. |
InputNumber, InputOTP | Controlled semantic value. |
Modal | Controlled 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.
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.
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.
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.
Related components
Controlled single and multiple selection ownership.
Controlled standalone and grouped disclosure state.
Controlled tab selection and screen composition.
Live change and commit semantics.
Controlled single/multiple value ownership and external search lifecycle.
Controlled visibility and dismissal requests.