Failed prop type: required variant missing in ReactBootstrap Alert
0 reputation · 03 Mar 2025, 00:00 UTC
Goal
Render a ReactBootstrap Alert without supplying the variant prop and determine whether the library should supply a default styling class or treat the omission as a failure.
Constraints
The component marks variant as required in PropTypes. Development builds emit Failed prop type: The `variant` prop is marked as required in `Alert`, but its value is `undefined`. Production builds suppress the warning, and the element renders without any alert-* class. No default variant is defined in source or documentation.
Should Alert fall back to a sensible default such as info or primary? Should the development warning be escalated to a runtime error? What pattern enforces variant presence across a codebase without relying only on console output?