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

2.0.0-beta-1: stringifyQuery and parseQueryString #254

Closed
ianks opened this issue Apr 27, 2016 · 2 comments
Closed

2.0.0-beta-1: stringifyQuery and parseQueryString #254

ianks opened this issue Apr 27, 2016 · 2 comments

Comments

@ianks
Copy link
Contributor

ianks commented Apr 27, 2016

I managed to get stringifyQuery and parseQuery string to work properly in 2.0.0-beta-1 by doing something like this:

const useRouterHistory = require('react-router').useRouterHistory;
const createHistory = require('history/lib/createBrowserHistory');
const createAppHistory = useRouterHistory(createHistory);

const appHistory = () => {
  return createAppHistory({
    stringifyQuery: qs.stringify,
    parseQueryString: qs.parse,
  });
};

const middleware = [
  reduxReactRouter({
    createHistory: appHistory,
  }),
];

export const baseMiddleware = compose(...middleware);

const Store = baseMiddleware(createStore)(rootReducer);

Everything seems to work fine. Query strings are parsed and serialized using the provided qs.parse and qs.stringify; however, the console gives me countless warnings about:

browser.js:49 Warning: useQueries does not stringify nested query objects by default; use a custom stringifyQuery function

Does anyone know a better way to achieve what I am trying to do which will not trigger warnings?

@ianks
Copy link
Contributor Author

ianks commented Apr 27, 2016

This will be solved by #255

@Scarysize
Copy link
Contributor

Thanks for your PR :-)

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

2 participants