title: How to return html text variable in react and print as html?
body: <blockquote>
    <p>Function 1 Which returns JSON array.</p>
  </blockquote>
  
  <pre><code>function allPlans()
  {
      var all_plans = {
              'Stock Card Views' : {
                  'free':{status:true,plantext:"5 Per Month"},
                  'premium':{status:true,plantext:"Unlimited"},
                  'vip':{status:true,plantext:"5 Per Month"}                            
              },
              'Portfolio Creation' : {
                  'free':{status:true,plantext:"Unlimited"},
                  'premium':{status:true,plantext:"Unlimited"},
                  'vip':{status:true,plantext:"Unlimited"}                            
              },
              'Transactions In A Portfolio' : {
                  'free':{status:true,plantext:"Unlimited"},
                  'premium':{status:true,plantext:"Unlimited"},
                  'vip':{status:true,plantext:"Unlimited"}                            
              },
              'Advance Filter':{
                  'free':{status:true,plantext:"-"},
                  'premium':{status:true,plantext:"Full Access"},
                  'vip':{status:true,plantext:"Full Access"}                            
              },
              'Stock Card Requests' : {
                  'free':{status:true,plantext:"-"},
                  'premium':{status:true,plantext:"3 Per Month"},
                  'vip':{status:true,plantext:"3 Per Month"}                            
              },
              'Premium Posrfolio Access' : {
                  'free':{status:true,plantext:"-"},
                  'premium':{status:true,plantext:"-"},
                  'vip':{status:true,plantext:"1 Portfolio"}                            
              },
              'Investment Pick' : {
                  'free':{status:true,plantext:"-"},
                  'premium':{status:true,plantext:"-"},
                  'vip':{status:true,plantext:"1 Per Month"}                            
              },
          }
  
      return all_plans;
  }
  </code></pre>
  
  <blockquote>
    <p>Function 2: Used Above function in below function</p>
  </blockquote>
  
  <pre><code>function renderPlansArray()
  {
  
      var all_plans = allPlans();
      var rowclass = true;
  
      var htmltext = "";
      for(var PlanName in all_plans) 
      {
  
          console.log(plan_item_gray);
          if (props.planname == 'free')
          {
  
              if(rowclass == true)
              {
                  rowclass = false;
                  htmltext += &lt;div className={plan_item_gray}&gt;all_plans[PlanName]['free']['plantext']&lt;/div&gt;;
              }
              else
              {
                  rowclass = true;
                  htmltext += &lt;div className={plan_item}&gt;all_plans[PlanName]['free']['plantext']&lt;/div&gt;;
              }
  
  
          }
  
      }
  
      return(htmltext);
  
  }
  </code></pre>
  
  <p>In the above function, I have generated an HTML Text in <code>htmltext</code> variable and return. But when I return same like above this will return [object Object] and when I convert into a string then it will print HTML text as it is.</p>
  
  <p>I want to return this variable as HTML.</p>
  
  <p>I have called above function in another function to render HTML like below.</p>
  
  <pre><code>return (&lt;div className={plan_column}&gt;
     {renderPlansArray()}
  &lt;/div&gt;)
  </code></pre>
  
  <blockquote>
    <p>It is returning:</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/5nP52.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5nP52.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>AND</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/duSum.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/duSum.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>I need HTML LIKE:</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/9mSc7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9mSc7.png" alt="enter image description here"></a></p>