pull/9801/head
Rich Harris 3 years ago
parent cbcc8e77c1
commit 26ef02d55d

@ -1196,17 +1196,15 @@ export function bind_property(property, event_name, type, dom, get_value, update
* @returns {void}
*/
export function bind_prop(props, prop, value) {
/** @param {V | null} value */
const update = (value) => {
if (get_descriptor(props, prop)?.set !== undefined) {
const desc = get_descriptor(props, prop);
if (desc && desc.set) {
props[prop] = value;
}
};
update(value);
render_effect(() => () => {
update(null);
props[prop] = null;
});
}
}
/**
* @param {Element} element_or_component

Loading…
Cancel
Save