hightjs 0.5.5 → 1.0.0
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.
|
@@ -84,7 +84,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
84
84
|
// Inicializa o componente e params baseado na URL ATUAL (não no initialComponentPath)
|
|
85
85
|
const [CurrentPageComponent, setCurrentPageComponent] = (0, react_1.useState)(() => {
|
|
86
86
|
// Pega a rota atual da URL
|
|
87
|
-
const currentPath = window.location.pathname;
|
|
87
|
+
const currentPath = window.location.pathname.replace("index.html", '');
|
|
88
88
|
const match = findRouteForPath(currentPath);
|
|
89
89
|
if (match) {
|
|
90
90
|
return componentMap[match.componentPath];
|
|
@@ -94,7 +94,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
94
94
|
});
|
|
95
95
|
const [params, setParams] = (0, react_1.useState)(() => {
|
|
96
96
|
// Pega os params da URL atual
|
|
97
|
-
const currentPath = window.location.pathname;
|
|
97
|
+
const currentPath = window.location.pathname.replace("index.html", '');
|
|
98
98
|
const match = findRouteForPath(currentPath);
|
|
99
99
|
return match ? match.params : {};
|
|
100
100
|
});
|
|
@@ -155,7 +155,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
155
155
|
};
|
|
156
156
|
}, []);
|
|
157
157
|
const updateRoute = (0, react_1.useCallback)(() => {
|
|
158
|
-
const currentPath = clientRouter_1.router.pathname;
|
|
158
|
+
const currentPath = clientRouter_1.router.pathname.replace("index.html", '');
|
|
159
159
|
const match = findRouteForPath(currentPath);
|
|
160
160
|
if (match) {
|
|
161
161
|
setCurrentPageComponent(() => componentMap[match.componentPath]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hightjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "HightJS is a high-level framework for building web applications with ease and speed. It provides a robust set of tools and features to streamline development and enhance productivity.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -61,7 +61,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
61
61
|
// Inicializa o componente e params baseado na URL ATUAL (não no initialComponentPath)
|
|
62
62
|
const [CurrentPageComponent, setCurrentPageComponent] = useState(() => {
|
|
63
63
|
// Pega a rota atual da URL
|
|
64
|
-
const currentPath = window.location.pathname;
|
|
64
|
+
const currentPath = window.location.pathname.replace("index.html", '');
|
|
65
65
|
const match = findRouteForPath(currentPath);
|
|
66
66
|
|
|
67
67
|
if (match) {
|
|
@@ -74,7 +74,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
74
74
|
|
|
75
75
|
const [params, setParams] = useState(() => {
|
|
76
76
|
// Pega os params da URL atual
|
|
77
|
-
const currentPath = window.location.pathname;
|
|
77
|
+
const currentPath = window.location.pathname.replace("index.html", '');
|
|
78
78
|
const match = findRouteForPath(currentPath);
|
|
79
79
|
return match ? match.params : {};
|
|
80
80
|
});
|
|
@@ -147,7 +147,7 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
const updateRoute = useCallback(() => {
|
|
150
|
-
const currentPath = router.pathname;
|
|
150
|
+
const currentPath = router.pathname.replace("index.html", '');
|
|
151
151
|
const match = findRouteForPath(currentPath);
|
|
152
152
|
if (match) {
|
|
153
153
|
setCurrentPageComponent(() => componentMap[match.componentPath]);
|