Ritu Singh
Problem:
I am trying to conditionally map through two different arrays in a reusable component. I can't seem to get it to work. Obviously, I could just split them in two, but I'm trying to make the component reusable. Any ideas?
In a different component, I have the two different types attached to the reusable component.
I tried to conditionally render it like this:
This didn't work (and is also not very good code), so any other ideas would be appreciated.
Solution:
Put both of the arrays in an object and refer to them by the appropriate key
Suggested blogs:
>Django Issue Solved: path searched will not match URL patterns
>Fix my form calling the wrong Django view error
>How is the value of the path column under the wagtailcore_page table populated?
>How to load static files using Nginx, Docker, and Django?
>How to tell Django "if anything in urlpatterns does not match the GET string?
>How can I browser to render links in streamed content in Django?
>Access the "model" attribute for a ListView in Django for template
>How to use a function to print S3 data to HTML using Django?