C
C
Captain Cocoa2021-06-25 11:17:16
React
Captain Cocoa, 2021-06-25 11:17:16

Conditional rendering or equivalent to Redux?

Guys, there is an online store and there is a component with ProductItem product card markup.
You need to display icons like: "New", "Gift" and "Super Price".
I’m thinking about how to properly implement the display of icons, do conditional rendering using React itself in the container component, or is it better to implement it somehow through Redux? If Redux, then in which direction to google?

I'm interested in correctness.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ParaBellum577, 2021-06-25
@RadCor

If it's just a question of rendering three icons, do it in the component, there's no need to take it out to the editor. Write a function that will give the desired icon depending on the data and that's it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question