Skip to content

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