-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
Hi!
I installed the package use-query-params: 1.1.7
but I'm getting this error When I used setQuery In react with ts, any sugestion?
App.tsx
import { BrowserRouter, Route } from 'react-router-dom';
import { QueryParamProvider } from 'use-query-params';
const App = (): React.ReactElement => {
return (
<BrowserRouter>
<QueryParamProvider ReactRouterRoute={Route}>
...
</QueryParamProvider>
</BrowserRouter>
);
})index.tsx
import { useQueryParams, StringParam } from 'use-query-params';
const Test = (): React.ReactElement => {
const [query, setQuery] = useQueryParams({
foo: StringParam,
});
const { foo } = query;
return (
<button onClick={() => setQuery({ foo: 'test!' })}>Test</button>
)
};I used
"use-query-params": "1.1.7",
"query-string": "6.13.2",
aviggiano, seyyed-sina and squarewave24hemi823
Metadata
Metadata
Assignees
Labels
No labels
