chore: deprecate <ChooseOne /> (#22107)

Based on previous PR reviews it appears we don't want to use these
components anymore. We previously deprecated the use of `<Stack />` in
this way in #20973 so it would be good to take the same approach here.
This commit is contained in:
Jake Howell
2026-02-20 12:54:25 +11:00
committed by GitHub
parent d23f5ea86f
commit 00d6f15e7c
@@ -17,6 +17,7 @@ interface CondProps {
* should not have a condition.
* @param condition boolean expression indicating whether the child should be rendered, or undefined
* @returns child. Note that Cond alone does not enforce the condition; it should be used inside ChooseOne.
* @deprecated Use standard conditional rendering (ternary operators or && expressions) instead.
*/
export const Cond: FC<CondProps> = ({ children }) => {
return <>{children}</>;
@@ -28,6 +29,7 @@ export const Cond: FC<CondProps> = ({ children }) => {
* will be rendered.
* @returns one of its children, or null if there are no children
* @throws an error if its last child has a condition prop, or any non-final children do not have a condition prop
* @deprecated Use standard conditional rendering (ternary operators or && expressions) instead.
*/
export const ChooseOne: FC<PropsWithChildren> = ({ children }) => {
const childArray = Children.toArray(children) as JSX.Element[];