@unsetsoft/ryunixjs 0.2.27-nightly.3 → 0.2.27
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.
- package/lib/dom.js +9 -1
- package/package.json +1 -1
package/lib/dom.js
CHANGED
|
@@ -100,6 +100,9 @@ function updateDom(dom, prevProps, nextProps) {
|
|
|
100
100
|
if (name === "style") {
|
|
101
101
|
DomStyle(dom, nextProps.style);
|
|
102
102
|
} else if (name === "className") {
|
|
103
|
+
if (nextProps.className === "") {
|
|
104
|
+
throw new Error("className cannot be empty.");
|
|
105
|
+
}
|
|
103
106
|
prevProps.className &&
|
|
104
107
|
dom.classList.remove(...prevProps.className.split(/\s+/));
|
|
105
108
|
dom.classList.add(...nextProps.className.split(/\s+/));
|
|
@@ -423,7 +426,6 @@ function reconcileChildren(wipFiber, elements) {
|
|
|
423
426
|
}
|
|
424
427
|
}
|
|
425
428
|
|
|
426
|
-
|
|
427
429
|
/**
|
|
428
430
|
* The function createContext creates a context object with a default value and methods to set and get
|
|
429
431
|
* the context value.
|
|
@@ -446,6 +448,12 @@ function createContext(defaultValue) {
|
|
|
446
448
|
}
|
|
447
449
|
|
|
448
450
|
function Fragments(props) {
|
|
451
|
+
if (props.style) {
|
|
452
|
+
throw new Error("The style attribute is not supported");
|
|
453
|
+
}
|
|
454
|
+
if (props.className === "") {
|
|
455
|
+
throw new Error("className cannot be empty.");
|
|
456
|
+
}
|
|
449
457
|
return createElement("div", props, props.children);
|
|
450
458
|
}
|
|
451
459
|
|