@mittwald/flow-react-components 1.1.18 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -342,6 +342,19 @@ Easy-to-miss conventions not spelled out above. Full details and examples in
342
342
  must affect layout.
343
343
  - **Controllers coexist with declarative props** — overlay-like APIs support
344
344
  controlled/uncontrolled props _and_ a controller object, not one or the other.
345
+ - **A component without `value` and without `defaultValue` still has to render
346
+ as controlled** — react-aria's `useControlledState` reads only `undefined` as
347
+ uncontrolled. A component that mirrors the value in its own state therefore
348
+ hands react-aria `undefined` on the first render and a real value after the
349
+ first change: the value changes owner mid-flight, and React and react-aria
350
+ warn `A component changed from uncontrolled to controlled`. Pass a sentinel
351
+ instead of `undefined` — `null` where "nothing selected yet" is representable
352
+ (`Tabs`' `selectedKey`), otherwise the type's empty value (`""` for text,
353
+ `NaN` for a number, `null` for a date range — `useControlledHostValueProps`'
354
+ `emptyValue`). Mind `??` once the sentinel is `null`: a caller-supplied `null`
355
+ must not fall through to `defaultValue`. Nothing breaks visibly, and a
356
+ component holding its own document state (`CodeEditor`) does not even warn —
357
+ it changes owner silently.
345
358
  - **Complex behavior is split by vocabulary** — `components/` for render,
346
359
  `hooks/` for behavior, `lib/` for pure transforms, `models/` for durable
347
360
  state.