@sitecore-jss/sitecore-jss-react 21.3.0-canary.2 → 21.3.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,12 +59,16 @@ const FEaaSComponent = (props) => {
|
|
|
59
59
|
let data = null;
|
|
60
60
|
if ((_b = props.params) === null || _b === void 0 ? void 0 : _b.ComponentDataOverride) {
|
|
61
61
|
// Use override data if provided
|
|
62
|
-
|
|
62
|
+
try {
|
|
63
|
+
data = JSON.parse(props.params.ComponentDataOverride);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
data = null;
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
else if (props.fields) {
|
|
65
70
|
// Otherwise use datasource data (provided in fields)
|
|
66
|
-
|
|
67
|
-
data = JSON.stringify({ _: getDataFromFields(props.fields) });
|
|
71
|
+
data = getDataFromFields(props.fields);
|
|
68
72
|
}
|
|
69
73
|
// FEaaS control would still be hydrated by client
|
|
70
74
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
|
@@ -30,12 +30,16 @@ export const FEaaSComponent = (props) => {
|
|
|
30
30
|
let data = null;
|
|
31
31
|
if ((_b = props.params) === null || _b === void 0 ? void 0 : _b.ComponentDataOverride) {
|
|
32
32
|
// Use override data if provided
|
|
33
|
-
|
|
33
|
+
try {
|
|
34
|
+
data = JSON.parse(props.params.ComponentDataOverride);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
data = null;
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
else if (props.fields) {
|
|
36
41
|
// Otherwise use datasource data (provided in fields)
|
|
37
|
-
|
|
38
|
-
data = JSON.stringify({ _: getDataFromFields(props.fields) });
|
|
42
|
+
data = getDataFromFields(props.fields);
|
|
39
43
|
}
|
|
40
44
|
// FEaaS control would still be hydrated by client
|
|
41
45
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "21.3.0-canary.
|
|
3
|
+
"version": "21.3.0-canary.3",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@sitecore-feaas/clientside": "^0.3.0",
|
|
65
|
-
"@sitecore-jss/sitecore-jss": "^21.3.0-canary.
|
|
65
|
+
"@sitecore-jss/sitecore-jss": "^21.3.0-canary.3",
|
|
66
66
|
"deep-equal": "^2.1.0",
|
|
67
67
|
"prop-types": "^15.8.1",
|
|
68
68
|
"style-attr": "^1.3.0"
|
|
69
69
|
},
|
|
70
70
|
"description": "",
|
|
71
71
|
"types": "types/index.d.ts",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "19aa6b7a74267c4e48c4fd9600c57704776fd800",
|
|
73
73
|
"files": [
|
|
74
74
|
"dist",
|
|
75
75
|
"types"
|