File tree Expand file tree Collapse file tree 2 files changed +25
-12
lines changed
source/library/components/py-loader Expand file tree Collapse file tree 2 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 1+ import { forwardRef , type ForwardedRef } from "react" ;
12import type { PyLoaderProperties , PyLoaderTag } from "./py-loader.types" ;
23
34/**
45 * @param root0
56 * @deprecated
67 */
7- const PyLoader : PyLoaderTag = < T extends object > ( {
8- ...rest
9- } : PyLoaderProperties < T > ) : JSX . Element => {
10- return < py-loader { ...rest } /> ;
11- } ;
8+ const PyLoader : PyLoaderTag = forwardRef (
9+ < OptionalProperties extends object > (
10+ properties : PyLoaderProperties < OptionalProperties > ,
11+ reference : ForwardedRef < HTMLElement > | undefined ,
12+ // eslint-disable-next-line max-params
13+ ) : JSX . Element => {
14+ return < py-loader ref = { reference } { ...properties } /> ;
15+ } ,
16+ ) as PyLoaderTag ;
1217
13- PyLoader . propTypes = { } ;
18+ PyLoader . displayName = "PyLoader" ;
1419
1520export default PyLoader ;
Original file line number Diff line number Diff line change 11import type {
22 DetailedHTMLProps ,
3+ ForwardedRef ,
34 HTMLAttributes ,
45 WeakValidationMap ,
56} from "react" ;
@@ -12,13 +13,20 @@ export type PyLoaderPropertiesBase = Omit<
1213 "children"
1314> ;
1415
15- export type PyLoaderProperties < T > = T extends infer T
16- ? T & PyLoaderPropertiesBase
17- : PyLoaderPropertiesBase ;
16+ export type PyLoaderProperties < OptionalProperties > =
17+ OptionalProperties extends infer OptionalProperties
18+ ? OptionalProperties & PyLoaderPropertiesBase
19+ : PyLoaderPropertiesBase ;
1820
19- export type PyLoaderProps < T > = PyLoaderProperties < T > ;
21+ export type PyLoaderProps < OptionalProperties > =
22+ PyLoaderProperties < OptionalProperties > ;
2023
2124export type PyLoaderTag = {
22- < T extends object > ( properties : PyLoaderProperties < T > ) : JSX . Element ;
23- propTypes : WeakValidationMap < PyLoaderPropertiesBase > ;
25+ < OptionalProperties extends object > (
26+ properties : PyLoaderProperties < OptionalProperties > ,
27+ reference ?: ForwardedRef < HTMLElement > ,
28+ ) : JSX . Element ;
29+ displayName ?: string ;
30+ defaultProps ?: Partial < PyLoaderPropertiesBase > ;
31+ propTypes ?: WeakValidationMap < PyLoaderPropertiesBase > ;
2432} ;
You can’t perform that action at this time.
0 commit comments