Your article is a great resource for beginner React developers, but also confusing, because you use class components. Lets simplify it by extracting all the conditional logic to two render methods: one to render the input box and another to render the button: Lets imagine that we have more than two branches that depend on the same variable to evaluate the condition. The issue was literally right in front of our faces. Im using the lovely ProcessWire (http://www.processwire.com) as my back-end for this, but Im sure a similar strategy could be used with a different platform or no platform at all. We want to make our HTML a function of our data. With the if/else statement implemented, the deliverable was achieved. With template strings its pretty easy tag function. Until ES2015, if you wanted to create a string in JavaScript from distinct pieces, for example, an existing string plus a number, it was a little messy. Line 36 takes all other cases, which is rendering them to the drop down menu, for this example. Conditional Rendering in React React facilitates the creation of multiple components, which in turn encloses the behaviour that we need for developing an application using it. This can help you conditionally render a part of the component while the rest of the output doesnt change. Using NPM Run npm install --save conditional-field, then reference the files in the HTML page. Let's start by exploring the simpler of these, the progress indicator, and show various ways in which it renders. This is exactly the material that I am focusing on right now using vanilla JS to brush up on the fundamentals of front-end dev and not always relying on the frameworks. The ternary operator is like an if-else, but for an expression instead of a set of statements: It takes the form [conditional] ? Please note that for the drop down menu, only the name of the kid is rendered, and NOT the img-url. This is because the code iterates through the ENTIRE API. innerHTML = blogPost.render(); } We then have to call update () whenever we modify state. The most simple and best readable answer will be to use an if block: Use ng-attr to render attribute based on condition. Is the DOM API code more readable than the innerHTML technique to render the progress bar? Like with most things in programming, some things are better suited than others depending on the problem youre trying to solve. Do roots of these polynomials approach the negative of the Euler-Mascheroni constant? Follow Up: struct sockaddr storage initialization by network format-string. The former is often more useful for large, complex applications with lots of moving parts, while the latter is a more elegant way to display information if you dont have a lot of dynamic state. I also very irregularly share non-codingthoughts. The below snippet uses jQuery. All we get to use are HTML, TypeScript/JavaScript, CSS, and the browser DOM (document object model). In same cases, though, one would like to skip a failing assignment and to proceed with the rest of the assignments (possibly logging the error), to avoid the whole rendering to fail because of a single error / typo. # Rendering Progress Indicators The progress indicator should appear while the app is determining which heroes to render. Examples Select Example Select Payment Method: Card Number: Check number: HTML Making statements based on opinion; back them up with references or personal experience. It adds a whole lot of lines for something that isnt that complicated, and it separates part of our rendering code from its place within the rest of the HTML. Consider these two new components representing Logout and Login buttons: In the example below, we will create a stateful component called LoginControl. Blogs, forums, etc. Finally, the rows array transform into the raw HTML, wrapped with a