Skip to content

Introduce skipNullsInQueryString option #2399

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

Closed
wants to merge 1 commit into from

Conversation

pascalbaljet
Copy link
Member

This PR introduces a skipNullsInQueryString visit option to exclude null values from the query string:

import { router } from '@inertiajs/react'

router.reload({ data: { foo: null } })

With the new option, it would make a request to / instead of /?foo. Still WIP because it misses tests, and I want to investigate if we could introduce a way to set this globally (same for queryStringArrayFormat).

@pascalbaljet
Copy link
Member Author

Closing this one. If you want to exclude it from the query string, you should use undefined:

router.reload({ data: { foo: undefined } })

@pascalbaljet pascalbaljet deleted the skip-nulls-in-query-string branch July 8, 2025 14:07
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

Successfully merging this pull request may close these issues.

1 participant