removeSerializableMapping
Available from 0.14.0
Makes Worklets forget the mapping of an object, whether it came from setSerializableMapping or from an earlier serialization. The next time the object is serialized, Worklets serializes the object itself and remembers the new mapping.
Reference
import {
removeSerializableMapping,
scheduleOnUI,
setSerializableMapping,
} from 'react-native-worklets';
const flag = { current: false };
setSerializableMapping(flag, { current: true });
removeSerializableMapping(flag);
scheduleOnUI(() => {
console.log(flag.current); // logs `false`
});


Type definitions
function removeSerializableMapping(value: object): void;
Arguments
value
The object whose mapping to remove. It's compared by reference.
Remarks
removeSerializableMappingalso removes mappings that Worklets or other libraries set.- If
valuehas no mapping,removeSerializableMappingdoes nothing. - Passing a SerializableRef does nothing.
- On the Web
removeSerializableMappingdoes nothing.