@react-aria/utils
Version:
Spectrum UI components in React
12 lines (10 loc) • 303 B
text/typescript
import {version} from 'react';
export function inertValue(value?: boolean): string | boolean | undefined {
const pieces = version.split('.');
const major = parseInt(pieces[0], 10);
if (major >= 19) {
return value;
}
// compatibility with React < 19
return value ? 'true' : undefined;
}