initial ssr visibility toggle
This commit is contained in:
parent
a89dc2c3de
commit
046c3642e6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user