@@ -16,6 +16,7 @@ export function DialogProvider({ children, ...providerOptions }) {
1616  const  [ show ,  setShow ]  =  useState ( false ) ; 
1717  const  [ showOptions ,  setShowOptions ]  =  useState ( { } ) ; 
1818  const  [ hidden ,  setHidden ]  =  useState ( true ) ; 
19+   const  hiddenRef  =  useRef ( hidden ) ; 
1920  const  previousHiddenRef  =  useRef ( hidden ) ; 
2021  const  resolveDoneRef  =  useRef ( null ) ; 
2122  const  resolveHiddenRef  =  useRef ( null ) ; 
@@ -44,6 +45,7 @@ export function DialogProvider({ children, ...providerOptions }) {
4445  } 
4546
4647  useEffect ( ( )  =>  { 
48+     hiddenRef . current  =  hidden ; 
4749    const  previousHidden  =  previousHiddenRef . current ; 
4850    previousHiddenRef . current  =  hidden ; 
4951    if  ( previousHidden  ===  false  &&  hidden  ===  true )  { 
@@ -54,7 +56,7 @@ export function DialogProvider({ children, ...providerOptions }) {
5456  const  dialog  =  useMemo ( ( )  =>  { 
5557    function  buildMethod ( methodOptions ,  failValue ,  okValue )  { 
5658      return  function ( text ,  userOptions )  { 
57-         if  ( ! hidden )  return  failValue ; 
59+         if  ( ! hiddenRef . current )  return  failValue ; 
5860
5961        setShow ( true ) ; 
6062        setHidden ( false ) ; 
0 commit comments