Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

Top 10HTML MCQ With Answers


Top 10 HTML  MCQ With Answers 

Top 10HTML  MCQ With Answers(part 9)



1] correct html tag to display an image?  

  a) <image>    b) <img>    c) <picture>   d) <src>

Answer : b) <img>

2] <img> tag attribute
   a) src
  b) title
  c) href
  d) a
 Answer a) src 

3]  Syntax for a HTML comment?

  a)  //comment
  b)  /* comment */
  c)  <!-- comment -->
  d) { comment }

Answer c) <!-- comment-->


4]  Correct HTML tah for creating a table?

   a)  <tr>
   b)  <td>
   c)  <th>
   d) <table>

Answer d) <table>

5] what tag use define a row html table?

     a) <tr>
     b) <td>
     c)  <th>
     d) <row>

Answer a) <tr>

6)  what tag use define cell inside table row

    a) <tr>
    b) <row>
    c) <td>
    d) <table>

Answer c) <td>

7] force extra spaces in a paragraph?

 
    a) nbsp;  b) <br>  c) <space>  d) text-space

Answer a) &nbsp;       

 8] add a line break inside a paragraph?

   a) <p>  b) <paragraph>  c) <text>  d)  <para>

Answer a) <p>


9) align  text inside a <p> tag?

   a) text-align in css b) align="center" in html  
  c) Both a & b         d) <p align="middle">

Answer c) both a and b


10) how do you change the text color inside a <p> tag using css?

 a) color   b) text-color  c) style-color  d) font-color

Answer a)color

Related Post :- 

program to print left pascal star pattern in php

Comments