File tree Expand file tree Collapse file tree
packages/components/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Algorithm } from '@rsdoctor/utils/common' ;
22import { Client , Manifest , Rule , SDK } from '@rsdoctor/types' ;
33import { uniqBy , defaults } from 'es-toolkit/compat' ;
4- import { useEffect , useState } from 'react' ;
4+ import { useEffect , useMemo , useState } from 'react' ;
55import { useTranslation } from 'react-i18next' ;
66import { useNavigate , useLocation } from 'react-router-dom' ;
77import parse from 'url-parse' ;
@@ -47,8 +47,8 @@ export function useRuleIndexNavigate(code: string, link?: string | undefined) {
4747
4848export function useUrlQuery ( ) {
4949 const search = useLocation ( ) . search || location . search ;
50- const { query } = parse ( search , true ) ;
51- return query ;
50+
51+ return useMemo ( ( ) => parse ( search , true ) . query , [ search ] ) ;
5252}
5353
5454export function useLoading ( defaultLoading = false ) {
You can’t perform that action at this time.
0 commit comments