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