initial ssr visibility toggle

This commit is contained in:
Seth Trowbridge 2023-05-15 22:29:12 -04:00
parent a89dc2c3de
commit 046c3642e6
1 changed files with 1 additions and 7 deletions

View File

@ -65,19 +65,15 @@ export const CollapseMenu =(props:{children:React.JSX.Element|React.JSX.Element[
React.useEffect(()=>
{
console.log(`menu animation start:${stateGet.Open}`);
refCollapse.current && refCollapse.current(stateGet.Open, 500, (state, id)=>
{
console.log("menu animation done", state, id);
stateSet({Done:true});
}
);
}, [stateGet.Open, stateGet.Done]);
console.log(`menu re-render: open:${stateGet.Open} done:${stateGet.Done} away:${stateGet.Away}`)
return <div ref={refEl as React.RefObject<HTMLDivElement>}>
{ props.children}
{ (stateGet.Done && !stateGet.Open) ? null : props.children}
</div>
};
@ -107,8 +103,6 @@ export function Collapser(inElement:HTMLElement, initialState = false)
return function(inOpen?:boolean, inMs?:number, inDone?:DoneCallback)
{
console.log("collapser sees", inOpen);
cancelAnimationFrame(frameRequest);
if(arguments.length)