1- import { FC , Fragment , PropsWithChildren , cloneElement , isValidElement , useState } from 'react' ;
2- import { Render , Provider , Container , useStore } from 'react-login-page' ;
1+ import { FC , PropsWithChildren , cloneElement , forwardRef , isValidElement , useState } from 'react' ;
2+ import { Render , Provider , Container , useStore , ContainerProps } from 'react-login-page' ;
33import { Email } from './control/login/Email' ;
44import { Password } from './control/login/Password' ;
55import { Submit } from './control/login/Submit' ;
@@ -139,11 +139,8 @@ const RenderLogin = () => {
139139 ) ;
140140} ;
141141
142- const LoginPage : FC < PropsWithChildren < React . HTMLAttributes < HTMLDivElement > > > = ( {
143- children,
144- className,
145- ...divProps
146- } ) => {
142+ const LoginPage = forwardRef < HTMLDivElement , ContainerProps > ( ( props , ref ) => {
143+ const { children, className, ...divProps } = props ;
147144 return (
148145 < Provider >
149146 < InnerBox />
@@ -163,15 +160,15 @@ const LoginPage: FC<PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>> = (
163160 Signup
164161 </ Submit >
165162
166- < Container { ...divProps } className = { `login-page10 ${ className || '' } ` } >
163+ < Container { ...divProps } ref = { ref } className = { `login-page10 ${ className || '' } ` } >
167164 < RenderLogin />
168165 { children }
169166 </ Container >
170167 </ Provider >
171168 ) ;
172- } ;
169+ } ) ;
173170
174- type LoginComponent = FC < PropsWithChildren < React . HTMLAttributes < HTMLDivElement > > > & {
171+ type LoginComponent = typeof LoginPage & {
175172 Email : typeof Email ;
176173 Password : typeof Password ;
177174 Submit : typeof Submit ;
0 commit comments