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

119
Views
Text Area with [Object object]

I created a component for my form, it looks like this

import React from "react";

export default function TextArea(name, value, onChange) {
  return (
    <div className="mt-1">
      <textarea
        rows={3}
        className="mt1 block w-full py-1.5 px-3 rounded-md border-2 border-orange-light"
        placeholder="Digite"
        value={value}
        onChange={onChange}
        name={name}
      />
    </div>
  );
}

But when I use it, it stays in an [object object], inside this textarea

But when I use it, it stays in an [object object], inside this textarea

I'm using it on my form this way

 <TextArea
    name="about"
    value={about}
    onChange={(e) => setAbout(e.target.value)} />

Can anyone tell what I should do to fix this? Thanks!

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

0

Here is the correct TextArea Component code, please try this and it will resolve your issue :)

import React from "react";

export default function TextArea({ name, value, onChange }) {
  return (
    <div className="mt-1">
      <textarea
        rows={3}
        className="mt1 block w-full py-1.5 px-3 rounded-md border-2 border-orange-light"
        placeholder="Digite"
        value={value}
        onChange={onChange}
        name={name}
      />
    </div>
  );
}

about 4 years ago · Juan Pablo Isaza Report

0

First do console.log(value) and find out what is in object , later use it like below with whichever property name your object got.

 value={value.propertyname} 
about 4 years ago · Juan Pablo Isaza Report

0

What parameter do you pass to 'value'? Most likely, what is being passed to the 'value' is an object, check that first so I can help you better.

UPDATE

when declaring the about, maybe it's being declared so that it stays as an object. then declare as:

const [about, setAbout] = useState("");
<TextArea
...,
value={about},
...
>
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!