File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -29,19 +29,21 @@ export function base ({
29
29
return Base
30
30
}
31
31
32
- export const extend = ( ( id = 0 ) => ( render ) => {
33
- const targetClassName = 'pss-' + id
32
+ const generateClassName = ( ( id ) => ( ) => {
33
+ id ++
34
+ return 'pss-' + id
35
+ } ) ( - 1 )
36
+
37
+ export function extend ( render ) {
38
+ const className = generateClassName ( )
34
39
35
40
const Comp = withRef ( ( props ) =>
36
- render ( { ...props , className : cx ( props . className , targetClassName ) } )
41
+ render ( { ...props , className : cx ( props . className , className ) } )
37
42
)
38
43
39
- Object . defineProperty ( Comp , 'toString' , {
40
- value ( ) {
41
- return `.${ targetClassName } `
44
+ return Object . defineProperties ( Comp , {
45
+ toString : {
46
+ value : ( ) => `.${ className } `
42
47
}
43
48
} )
44
-
45
- id ++
46
- return Comp
47
- } ) ( )
49
+ }
You can’t perform that action at this time.
0 commit comments