Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useUpdateSearchParams does not work with the react native app #468

Open
1 of 3 tasks
wongk opened this issue Apr 23, 2024 · 1 comment
Open
1 of 3 tasks

useUpdateSearchParams does not work with the react native app #468

wongk opened this issue Apr 23, 2024 · 1 comment

Comments

@wongk
Copy link

wongk commented Apr 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Do you want this issue prioritized?

  • Yes, I have sponsored
  • Not urgent

Current Behavior

I am using the useUpdateSearchParams API to set a query parameter on the route. It is working fine on web.

const updateParams = useUpdateSearchParams()
updateParams({ threadId: item.id }, { webBehavior: "replace" })

This does not work on mobile. The following log statement is always empty:

const params = useSearchParams()
useEffect(() => {
    console.info(`Params: ${params?.toString()}`)
}, [params])

Expected Behavior

No response

Steps To Reproduce

No response

Versions

- Solito: 4.2.2
- Next.js: 13.5.6
- Expo: 50.0.14
- React Native: 0.73.6

Screenshots

No response

Reproduction

No response

@wongk
Copy link
Author

wongk commented Apr 23, 2024

As a workaround, manually setting the query param works fine for my use case:
router.replace(``/chat?threadId=${item.id}``)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant