Skip to content

Commit 45ba383

Browse files
authored
bump version to 3.3.3 and update prop value formatting in ContentItem component (#3435)
1 parent a303ba1 commit 45ba383

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docuilib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-docs",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"main": "./src/index.ts",
55
"scripts": {
66
"docusaurus": "docusaurus",

docuilib/src/components/pageComponents/ContentItem.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ const ComponentItem = (props: ComponentItemProps) => {
1111
const {componentName, props: componentProps} = props;
1212
const isComponentExists = !!ReactLiveScope[componentName];
1313
const propString = Object.keys(componentProps).reduce((acc, key) => {
14-
const propValue = componentProps[key];
14+
let propValue = componentProps[key];
1515
switch (typeof propValue) {
1616
case 'object':
17-
return `${acc}${key}={${JSON.stringify(propValue)}} `;
17+
propValue = JSON.stringify(propValue);
18+
break;
1819
case 'string':
19-
return `${acc}${key}="${propValue}" `;
20+
propValue = `"${propValue}"`;
21+
break;
2022
default:
21-
return `${acc}${key}={${propValue}} `;
2223
}
24+
return `${acc}${key}={${propValue}} `;
2325
}, '');
2426

2527
const code = isComponentExists ? `<${componentName} ${propString} />` : '<Text>Component Not Found</Text>';

0 commit comments

Comments
 (0)