A
A
Andrey Okhotnikov2019-07-02 18:00:24
React
Andrey Okhotnikov, 2019-07-02 18:00:24

Is it normal to store data in a URL?

The site is based on React, there are some parameters, for example, color, product size, they can change, so the question is - is it normal to keep the actual value in the URL without passing it somewhere else (Redux for example) ? When changing the parameter, I just update the url
url like site/product/123?color=5&size=19

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2019-07-02
@rockon404

If you yourself do not know why you need this data in the store, then they most likely are not needed there.

O
Oleg Gamega, 2019-07-02
@gadfi

url like site/product/123?color=5&size=19
if this page shows products of 5 colors, 19 sizes, then yes, but if it’s just that in ui, you need to make size 19 and color 5, then no

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question