@vetc-miniapp/ui-react 0.0.7 → 0.0.8

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": "@vetc-miniapp/ui-react",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "MiniApp Platform UI React",
5
5
  "main": "src/ui-react/index.js",
6
6
  "types": "src/ui-react/index.ts",
@@ -27,17 +27,16 @@ export function App({ config, children }) {
27
27
  const [page, setPage] = useState(null);
28
28
 
29
29
  useEffect(() => {
30
- console.warn("SDK useEffect fired");
31
30
 
32
31
  if (!config?.pages?.length) return;
33
32
 
34
33
  // 1. Init router từ config
35
34
  initRouter(config);
36
- console.warn(config);
37
35
 
38
36
  // 2. Lấy pathname từ URL WebView
39
37
  const rawPath = window.location.path || "/";
40
38
  const path = rawPath.replace("/miniapp", "") || "/";
39
+ console.log(rawPath);
41
40
 
42
41
  setCurrentPath(path);
43
42
 
@@ -52,17 +51,16 @@ export function App({ config, children }) {
52
51
  }
53
52
 
54
53
  setPage(current);
55
-
56
54
  // 5. Gửi config sang Flutter để dựng native header
57
55
  callHost("registerAppConfig", { config });
58
56
  }, [config]);
59
57
 
60
- console.warn("SDK fired");
61
58
 
62
- // Tránh crash nếu chưa có page
63
59
  if (!page || !page.Component) {
64
60
  console.warn("MiniApp: Page not found for current route");
65
- return <div />; // hoặc spinner
61
+ return (
62
+ <div></div>
63
+ );
66
64
  }
67
65
 
68
66
  const Component = page.Component || <div />;