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

silverlight513
  • 5,268
  • 4
  • 26
  • 38
  • DId you manage to solve this? – LorneCurrie Apr 11 '17 at 20:13
  • Possible duplicate of [In react-router V4 how can I programmatically set the query string params?](https://stackoverflow.com/questions/44133994/in-react-router-v4-how-can-i-programmatically-set-the-query-string-params) – Paul Sweatte Sep 06 '17 at 06: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 – silverlight513 Sep 07 '17 at 08:12

0 Answers0