react-toolkits 2.11.8 → 2.11.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 2.11.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 5241a1b: fix: missing Navigate
8
+
3
9
  ## 2.11.8
4
10
 
5
11
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -487,7 +487,7 @@ type JsonData<T = any> = {
487
487
  };
488
488
  declare const Interceptor: ({ children }: {
489
489
  children?: ReactNode;
490
- }) => string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
490
+ }) => ReactNode;
491
491
 
492
492
  declare const mixedStorage: StateStorage;
493
493
 
package/lib/index.js CHANGED
@@ -4,14 +4,14 @@ import { create, useStore, createStore } from 'zustand';
4
4
  import { persist, createJSONStorage } from 'zustand/middleware';
5
5
  import * as Antd2 from 'antd';
6
6
  import { Spin, Menu, Modal, Form, App, theme, Space, Input, Tag, Typography, Result, Table, Button, Empty, Dropdown, Divider, Card, Select, Alert, Switch, InputNumber, Row, Col, Breadcrumb, Skeleton, Descriptions, Tooltip, Popconfirm, Collapse, Checkbox } from 'antd';
7
- import { useLocation, Routes, Route, Navigate, Link, useNavigate, useParams } from 'react-router-dom';
8
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
7
  import { memo, useMemo, useCallback, useEffect, lazy, useContext, useState, useRef, Fragment as Fragment$1, Suspense, createContext, forwardRef, useImperativeHandle, cloneElement } from 'react';
10
8
  import useSWR5, { mutate, SWRConfig, unstable_serialize } from 'swr';
9
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
10
  import { has, template, get, isEqual } from 'lodash-es';
12
11
  import { flushSync } from 'react-dom';
13
12
  import { createRoot } from 'react-dom/client';
14
13
  import useSWRMutation2 from 'swr/mutation';
14
+ import { useLocation, Routes, Route, Navigate, Link, useNavigate, useParams } from 'react-router-dom';
15
15
  import { Editor } from '@monaco-editor/react';
16
16
  import { PlusOutlined, LogoutOutlined, UserOutlined, MenuUnfoldOutlined, MenuFoldOutlined, UserAddOutlined, UsergroupAddOutlined } from '@ant-design/icons';
17
17
  import { produce } from 'immer';
@@ -284,7 +284,8 @@ var init_axios = __esm({
284
284
  const state = useToolkitsStore((s) => s);
285
285
  const { notification } = App.useApp();
286
286
  if (!state.token) {
287
- return /* @__PURE__ */ jsx(Navigate, { to: state.signInPath });
287
+ window.location.replace(state.signInPath);
288
+ return null;
288
289
  }
289
290
  if (requestInterceptorId) {
290
291
  axiosInstance.interceptors.request.eject(requestInterceptorId);