Hello, I’m kinda new to React. I know basics (i think…) but you know what ppl say. Practise makes perfect. So I want to do eCommerce site. Before I do anything, I like to think about it. So I’m wondering how to filer products basing on what user wants to see. Let’s look at an example:
User wants to see products with these parameters
size: 40, 42
price: < 100$
Now couple of questions:
- Should I filter products on server side or client side? I think the second option is much better.
- If client side - I need some filter function like Array.filter() but it needs to be dynamic. This is gonna be tough I guess…
- When should I update state? On every checkbox selected? Someone checks size 42 - reRendering. Another one size or color? - reRendering. So every one checkbox should be linked to filter function, right?