Block an async flow and unblock it from an external context.
The type of value that can be passed to unblock to resolve the Promise returned by block.
unblock
Promise
block
const [isBlocked, block, unblock] = useBlocker<string>();useEffect(() => { // Returns a Promise that is resolved with the value passed to unblock(value) block(); // → Promise<string> // Unblocks the blocker with given value unblock('Hello');}, []); Copy
const [isBlocked, block, unblock] = useBlocker<string>();useEffect(() => { // Returns a Promise that is resolved with the value passed to unblock(value) block(); // → Promise<string> // Unblocks the blocker with given value unblock('Hello');}, []);
Block an async flow and unblock it from an external context.