erikras / erikras/react-redux-universal-hot-example
Allowing for custom query string parsing
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
If you enter a URL with a malformed query param (e.g. `http://localhost:3000/?key=%`) you get a `URI malformed` error.
On vanilla react-router apps, you can provide a custom query parser to catch these errors.
https://github.com/ReactTraining/react-router/blob/master/upgrade-guides/v2.0.0.md#custom-query-string-parsing
```
import { useRouterHistory } from 'react-router'
import createBrowserHistory from 'history/lib/createBrowserHistory'
const createAppHistory = useRouterHistory(createBrowserHistory)
const appHistory = createAppHistory({
parseQueryString: () => {
// parse here
},
stringifyQuery: stringify
})
```
Where would one add custom query string parsing in this boilerplate?
Contributor guide
Assessment
This issue has not been assessed yet.