I suggest adding an else block with setSelectedItems([]); in ReactMediaLibrary.tsx line no 17.
So, the updated useEffect hook will be
useEffect(() => {
// Asset loads are sometimes async.
// Need to check the default and reselect if either the file library list or default select list is updated.
if (props.defaultSelectedItemIds?.length) {
const filterDefaultSelected = props.fileLibraryList.filter((item) => props.defaultSelectedItemIds?.includes(item._id));
setSelectedItems(filterDefaultSelected);
} else {
setSelectedItems([]);
}
}, [props.fileLibraryList, props.defaultSelectedItemIds]);
Please update it so selected items in ReactMediaLibrary can be cleared.