Capítulo 84 de 116
experimental_taintUniqueValue(message, lifetime, value) is taintObjectReference's sibling for primitive values (strings, numbers) — flags a specific sensitive value (an API key, a session token) so React throws if that exact value is ever serialized across the Server→Client boundary.
lifetime argument (an object whose garbage-collected lifetime the taint is tied to) so React knows how long to keep watching for that value.lifetime argument: typically the object the sensitive value was extracted from (e.g. the config/env object holding a secret) — once that object is garbage collected, the taint on the derived primitive value is released too, preventing an unbounded internal tracking list.taintObjectReference: if the tainted value is ever passed into something destined for client serialization, React throws with the given message instead of silently including the secret in the client bundle/payload.const apiKey = process.env.SECRET_API_KEY;
experimental_taintUniqueValue(
'Do not pass SECRET_API_KEY to the client.',
process.env, // lifetime: taint released when this object is GC'd
apiKey
);
process.env object it came from.taintObjectReference (Ch 83) for whole sensitive objects.lifetime argument exists purely for garbage-collection bookkeeping — pick an object whose lifetime naturally matches how long the taint should remain active.