React without React? How Wagtail Changed My View of UI
Last year, I learnt React from Full Stack Open. I was quite fascinated by the idea of components because of how they act like Lego blocks. Until very recently, I used to think that React is the onl...

Source: DEV Community
Last year, I learnt React from Full Stack Open. I was quite fascinated by the idea of components because of how they act like Lego blocks. Until very recently, I used to think that React is the only way to create UI components for websites. Exploring Wagtail taught me otherwise. I now know two ways to create UI components without React. 1. UI components in Django templates (for Wagtail) I created a simple Wagtail site to showcase some of my Hange Zoë artworks. This was the first time I used "React without React". For example, I created an image component (image.html) that can be used in many pages and even in other components. {% load wagtailimages_tags %} <div class="overflow-hidden rounded-4"> {% if variant == "large" %} {% srcset_image image width-{500,800} sizes="(max-width: 600px) 500px, 800px" %} {% elif variant == "medium" %} {% srcset_image image width-{300,800} sizes="(max-width: 600px) 300px, 800px" %} {% elif variant == "thumbnail" %} {% image image fill-200x200 %} {%