@resistdesign/voltra 3.0.0-alpha.22 → 3.0.0-alpha.23
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/app/index.js +17 -17
- package/app/utils/Route.d.ts +1 -1
- package/package.json +1 -1
package/app/index.js
CHANGED
|
@@ -1120,12 +1120,25 @@ var RouteRootProvider = ({
|
|
|
1120
1120
|
return /* @__PURE__ */ jsx(RouteProvider, { adapter: autoAdapterRef.current, initialPath, children });
|
|
1121
1121
|
};
|
|
1122
1122
|
var Route = (props) => {
|
|
1123
|
-
|
|
1124
|
-
|
|
1123
|
+
const hasMatcherProps = typeof props.path !== "undefined" || typeof props.exact !== "undefined" || typeof props.onParamsChange !== "undefined";
|
|
1124
|
+
const hasProviderProps = typeof props.initialPath !== "undefined" || typeof props.adapter !== "undefined" || typeof props.ingress !== "undefined";
|
|
1125
|
+
if (hasMatcherProps) {
|
|
1126
|
+
if (hasProviderProps && isDevelopmentMode()) {
|
|
1125
1127
|
throw new Error(
|
|
1126
|
-
"Route
|
|
1128
|
+
"Route matcher mode does not support provider props. Remove initialPath/adapter/ingress or use a root Route without path."
|
|
1127
1129
|
);
|
|
1128
1130
|
}
|
|
1131
|
+
return /* @__PURE__ */ jsx(
|
|
1132
|
+
RouteMatcher,
|
|
1133
|
+
{
|
|
1134
|
+
path: props.path ?? "",
|
|
1135
|
+
onParamsChange: props.onParamsChange,
|
|
1136
|
+
exact: props.exact,
|
|
1137
|
+
children: props.children
|
|
1138
|
+
}
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
if (typeof props.path === "undefined") {
|
|
1129
1142
|
return /* @__PURE__ */ jsx(
|
|
1130
1143
|
RouteRootProvider,
|
|
1131
1144
|
{
|
|
@@ -1136,20 +1149,7 @@ var Route = (props) => {
|
|
|
1136
1149
|
}
|
|
1137
1150
|
);
|
|
1138
1151
|
}
|
|
1139
|
-
|
|
1140
|
-
throw new Error(
|
|
1141
|
-
"Route matcher mode does not support provider props. Remove initialPath/adapter/ingress or use a root Route without path."
|
|
1142
|
-
);
|
|
1143
|
-
}
|
|
1144
|
-
return /* @__PURE__ */ jsx(
|
|
1145
|
-
RouteMatcher,
|
|
1146
|
-
{
|
|
1147
|
-
path: props.path,
|
|
1148
|
-
onParamsChange: props.onParamsChange,
|
|
1149
|
-
exact: props.exact,
|
|
1150
|
-
children: props.children
|
|
1151
|
-
}
|
|
1152
|
-
);
|
|
1152
|
+
return null;
|
|
1153
1153
|
};
|
|
1154
1154
|
|
|
1155
1155
|
// src/common/IdGeneration/getSimpleId.ts
|
package/app/utils/Route.d.ts
CHANGED
|
@@ -133,4 +133,4 @@ export type RouteProps<ParamsType extends Record<string, any>> = {
|
|
|
133
133
|
*/
|
|
134
134
|
ingress?: UniversalRouteIngress;
|
|
135
135
|
};
|
|
136
|
-
export declare const Route: <ParamsType extends Record<string, any>>(props: PropsWithChildren<RouteProps<ParamsType>>) => import("react/jsx-runtime").JSX.Element;
|
|
136
|
+
export declare const Route: <ParamsType extends Record<string, any>>(props: PropsWithChildren<RouteProps<ParamsType>>) => import("react/jsx-runtime").JSX.Element | null;
|