Using splitProps to preserve reactivity in LoginModal
This commit is contained in:
		
							parent
							
								
									fafce18907
								
							
						
					
					
						commit
						da4f5cbb13
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -1,4 +1,4 @@ | |||
| import { JSXElement, Show, onCleanup, useContext } from "solid-js"; | ||||
| import { JSXElement, Show, onCleanup, splitProps, useContext } from "solid-js"; | ||||
| 
 | ||||
| import { LoginForm } from "../Components/Login"; | ||||
| import { RegisterForm } from "../Components/Register"; | ||||
|  | @ -61,10 +61,11 @@ export function LoginModal(): JSXElement { | |||
| } | ||||
| 
 | ||||
| // Local wrapper component for the login and register forms
 | ||||
| function FormContainer({ children }: { children: JSXElement }): JSXElement { | ||||
| function FormContainer(props: { children: JSXElement }): JSXElement { | ||||
|   const [local] = splitProps(props, ["children"]); | ||||
|   return ( | ||||
|     <div class="tab-content rounded-box border-base-300 bg-base-100 p-2 md:p-10"> | ||||
|       <span class="label-text">{children}</span> | ||||
|       <span class="label-text">{local.children}</span> | ||||
|     </div> | ||||
|   ); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus