vexio-font-static
Version:
Disable font scaling in React Native for Text and TextInput components.
16 lines (15 loc) • 776 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.disableFontScaling = void 0;
var react_native_1 = require("react-native");
var disableFontScaling = function () {
// Cast to any to avoid TypeScript errors
react_native_1.Text.defaultProps = react_native_1.Text.defaultProps || {};
react_native_1.Text.defaultProps.allowFontScaling = false;
react_native_1.TextInput.defaultProps = react_native_1.TextInput.defaultProps || {};
react_native_1.TextInput.defaultProps.allowFontScaling = false;
console.log('vexio-font-static: Font scaling disabled globally');
};
exports.disableFontScaling = disableFontScaling;
// Immediately apply the font scaling disable when the package is imported
(0, exports.disableFontScaling)();