mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-19 06:43:16 +08:00
docs: add query searching to components overview (#41095)
This commit is contained in:
parent
48d9c625df
commit
767db3c6ca
@ -99,7 +99,13 @@ const Overview: React.FC = () => {
|
||||
const { search: urlSearch } = useLocation();
|
||||
const { locale, formatMessage } = useIntl();
|
||||
|
||||
const [search, setSearch] = useState<string>('');
|
||||
const [search, setSearch] = useState<string>(() => {
|
||||
const params = new URLSearchParams(urlSearch);
|
||||
if (params.has('s')) {
|
||||
return params.get('s');
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
||||
const sectionRef = useRef<HTMLElement>(null);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user