File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
src/components/pageComponents Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " uilib-docs" ,
3
- "version" : " 3.3.2 " ,
3
+ "version" : " 3.3.3 " ,
4
4
"main" : " ./src/index.ts" ,
5
5
"scripts" : {
6
6
"docusaurus" : " docusaurus" ,
Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ const ComponentItem = (props: ComponentItemProps) => {
11
11
const { componentName, props : componentProps } = props ;
12
12
const isComponentExists = ! ! ReactLiveScope [ componentName ] ;
13
13
const propString = Object . keys ( componentProps ) . reduce ( ( acc , key ) => {
14
- const propValue = componentProps [ key ] ;
14
+ let propValue = componentProps [ key ] ;
15
15
switch ( typeof propValue ) {
16
16
case 'object' :
17
- return `${ acc } ${ key } ={${ JSON . stringify ( propValue ) } } ` ;
17
+ propValue = JSON . stringify ( propValue ) ;
18
+ break ;
18
19
case 'string' :
19
- return `${ acc } ${ key } ="${ propValue } " ` ;
20
+ propValue = `"${ propValue } "` ;
21
+ break ;
20
22
default :
21
- return `${ acc } ${ key } ={${ propValue } } ` ;
22
23
}
24
+ return `${ acc } ${ key } ={${ propValue } } ` ;
23
25
} , '' ) ;
24
26
25
27
const code = isComponentExists ? `<${ componentName } ${ propString } />` : '<Text>Component Not Found</Text>' ;
You can’t perform that action at this time.
0 commit comments