Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: fix lint warning about useEffect (#38285)

Simon Knott375697850f9a
diff --git a/packages/html-reporter/src/headerView.tsx b/packages/html-reporter/src/headerView.tsx
index b819b47927..8f82dcedaa 100644
--- a/packages/html-reporter/src/headerView.tsx
+++ b/packages/html-reporter/src/headerView.tsx
@@ -49,11 +49,11 @@ export const GlobalFilterView: React.FC<{
setFilterText: (filterText: string) => void,
}> = ({ stats, filterText, setFilterText }) => {
const searchParams = useSearchParams();
+ const query = searchParams.get('q');
React.useEffect(() => {
// Add an extra space such that users can easily add to query
- const query = searchParams.get('q');
setFilterText(query ? `${query.trim()} ` : '');
- }, [searchParams.toString(), setFilterText]);
+ }, [query, setFilterText]);
return (<>
<div className='pt-3'>