0

I've just converted my application over to React with Redux and on one page I'm creating an item. Instead of opting for a save button I'm just going to automatically save the item when the user stops typing. The problem I have is that if they refresh the page, I want the application to be able to get the item the user created instead of a blank one.

The way I want to be able to handle this occurrence is to add the ID as a query parameter to the URL so when they refresh I know what item to fetch from the API.

How would I add a query parameter to the URL in a react/redux/react-router application?

I want something like website.com/create-item?id=1234

3
  • DId you manage to solve this? Commented Apr 11, 2017 at 20:13
  • Possible duplicate of In react-router V4 how can I programmatically set the query string params? Commented Sep 6, 2017 at 6:25
  • @PaulSweatte This question was for V3. V4 hadn't been released at the time so it can't possibly be a duplicate. I've updated the title to specify v3 due to API differences Commented Sep 7, 2017 at 8:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.