ReactFix
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • React
  • React Native
  • Programming
  • Object Oriented Programming

Friday, November 25, 2022

[FIXED] How to use prop in html class

 November 25, 2022     reactjs   

Issue

<textarea class="form-control quiz"{item.title}"" id="exampleFormControlTextarea1" rows="3"></textarea>

in this example i want to add item.title prop with quiz class

I want to add prop with quiz class so how should I concatenate this scenario


Solution

You can do it this way

<textarea className={`form-control quiz${item.title}`} id="exampleFormControlTextarea1" rows="3">


Answered By - Muhiq kapadia
Answer Checked By - - Senaida (ReactFix Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Post Older Post Home

Featured Post

Is Learning React Difficult?

React is difficult to learn, no ifs and buts. React isn't inherently difficult to learn. It's a framework that's different from ...

Total Pageviews

Copyright © ReactFix