import { applyStyle } from '../internal/applyStyle'; import { useChecks } from '../internal/useChecks'; export type UseExpandable = Omit & { expanded: boolean; }; export const useExpandable = (props: UseExpandable) => { const checks = __DEV__ ? useChecks?.() : undefined; __DEV__ && checks?.noUndefinedProperty>({ properties: props, // @ts-ignore property: 'expanded', rule: 'NO_UNDEFINED', }); __DEV__ && checks?.noUndefinedProperty>({ properties: props, // @ts-ignore property: 'accessibilityLabel', rule: 'NO_UNDEFINED', }); /* block:end */ return __DEV__ ? { accessibilityRole: 'button' as any, ...props, style: applyStyle?.({ // @ts-ignore style: props.style, // @ts-ignore debugStyle: checks?.debugStyle, }), } : { accessibilityRole: 'button' as any, ...props, }; };