Files
starface-outlook-sync-addin/node_modules/@fluentui/utilities/lib-amd/controlled.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

17 lines
769 B
JavaScript

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isControlled = isControlled;
/**
* Determines whether a component is controlled.
* @param props - Component props
* @param valueProp - Prop containing the controlled value
* @returns true if controlled, false if uncontrolled
*/
function isControlled(props, valueProp) {
// React's built-in <input> considers a prop to be provided if its value is non-null/undefined.
// Mirror that behavior here (rather than checking for just undefined).
return props[valueProp] !== undefined && props[valueProp] !== null;
}
});
//# sourceMappingURL=controlled.js.map