moved cleanup out of mount
This commit is contained in:
		
							parent
							
								
									33d3ce46c4
								
							
						
					
					
						commit
						eeb2b46f76
					
				
					 2 changed files with 6 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -47,11 +47,10 @@ const NavComponent: Component<NavProps> = props => {
 | 
			
		|||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  onMount(() => {
 | 
			
		||||
  onMount(() => {});
 | 
			
		||||
  onCleanup(() => {
 | 
			
		||||
    window.removeEventListener("click", handleClickOutside);
 | 
			
		||||
  });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  createEffect(() => {
 | 
			
		||||
    if (open()) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,11 +40,10 @@ const TableOfContents: Component<TOCProps> = props => {
 | 
			
		|||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  onMount(() => {
 | 
			
		||||
  onMount(() => {});
 | 
			
		||||
  onCleanup(() => {
 | 
			
		||||
    window.removeEventListener("click", handleClickOutside);
 | 
			
		||||
  });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  createEffect(() => {
 | 
			
		||||
    if (open()) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue