@unsetsoft/ryunixjs 0.3.6 → 0.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "private": false,
@@ -27,7 +27,6 @@
27
27
  "@babel/polyfill": "7.12.1",
28
28
  "@babel/preset-env": "^7.22.14",
29
29
  "@babel/preset-react": "^7.22.5",
30
- "@mdx-js/loader": "^2.3.0",
31
30
  "babel-loader": "^9.1.3",
32
31
  "crypto": "^1.0.1",
33
32
  "css-loader": "^6.8.1",
@@ -25,7 +25,7 @@ const Router = ({ path, component }) => {
25
25
  const Navigate = (props) => {
26
26
  if (props.style) {
27
27
  throw new Error(
28
- "The style attribute is not supported on internal components."
28
+ "The style attribute is not supported on internal components, use className."
29
29
  );
30
30
  }
31
31
  if (props.to === "") {
@@ -34,12 +34,12 @@ const Navigate = (props) => {
34
34
  if (props.className === "") {
35
35
  throw new Error("className cannot be empty.");
36
36
  }
37
- if (props.label === "") {
37
+ if (props.label === "" && !props.children) {
38
38
  throw new Error("'label=' cannot be empty.");
39
39
  }
40
40
 
41
- if (!props.label || !props.to) {
42
- throw new Error("Missig component params.");
41
+ if (!props.to) {
42
+ throw new Error("Missig 'to' param.");
43
43
  }
44
44
  const preventReload = (event) => {
45
45
  event.preventDefault();
@@ -55,7 +55,10 @@ const Navigate = (props) => {
55
55
  onClick: preventReload,
56
56
  ...props,
57
57
  };
58
- return createElement("a", anchor, props.label);
58
+
59
+ const children = props.children ? props.children : props.label;
60
+
61
+ return createElement("a", anchor, children);
59
62
  };
60
63
 
61
64
  export { Router, Navigate };