@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
10 lines (9 loc) • 403 B
JavaScript
import reactMajor from "./reactMajor.js";
const inertBooleanSupported = reactMajor >= 19;
/**
* Before version 19, react JSX treats empty string "" as truthy for inert prop.
* @see {@link https://stackoverflow.com/questions/72720469}
* @see {@link https://github.com/facebook/react/issues/17157}
* */
const isInert = inertBooleanSupported ? x => x : x => x ? "" : undefined;
export default isInert;