COVID-19 Symptoms Usually Show Up in This Order

In India, there are many qualified and experienced Neurologists who have dealt with various In India, there are many qualified and experienced Neurologists who have dealt with various In India, there are many qualified and experienced Neurologists who have dealt with various

Component templates are used in Scrumpy in several places such as notifications, comments, and attachments. Let’s take a look at comments and see what I actually mean by that.

Comments are no longer just simple text fields today. You expect to be able to post links, upload images, integrate videos and much more. All these completely different elements must be rendered in this comment. If you try to do this within one component, it can quickly become an absolute mess.

How can we deal with this problem? Probably most people would check all cases and then load specific components after that. Something like this:

However, this can become very cluttered and repetitive if the list of supported templates becomes longer and longer. In our case of comments— just think of supporting embeds for Youtube, Twitter, Github, Soundcloud, Vimeo, Figma… the list is endless.

Dynamic Component Templates

Another way is to have some kind of loader that loads exactly the template you need. This allows you to write a clean component like this:

Looks much better, doesn’t it? Let’s see how this component works. First, we have to change the folder structure for our templates.

Personally, I like to create a folder for each component, because more files for styling and testing can be added later. How you want to build the structure is up to you, of course.

Next, we look at how this dynamic-link component is built.

Testimonials

Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful professional.

Kristi Bruno
Knee Specialist

Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful professional.

Kristi Bruno
Knee Specialist

Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful professional.

Kristi Bruno
Knee Specialist