Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

82
Views
Passing integers to JSX attributes
return <textarea className="tox-input" rows=2 ></textarea>;

I want to pass rows=2 to this tag. However, this results in the following error.

Parsing error: JSX value should be either an expression or a quoted JSX text.

After a bit of research, I couldn't find a way to solve this. Please could someone tell me the proper way to do it in JSX?

Note: Using rows={2} doesn't give an error, but it only shows one row.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Use curly brace:

return <textarea className="tox-input" rows={2} ></textarea>;

It will pass integer.

Playground area

about 4 years ago · Juan Pablo Isaza Report

0

Using rows={2} is the right call. Look for any css rule that limits the max height of the textarea or a parent element that does this.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!