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

227
Views
A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value,

//constructor which i have initialised before only.

const [groupChatName, setGroupChatName] = useState();

// updated part where values is showing that it is undefined and it is changing from uncontrolled to controlled

<FormControl d="flex">
          <Input
            placeholder="Group Name"
            mb={3}
            value={groupChatName}
            onChange={(e) => setGroupChatName(e.target.value)}
          />
          <Button
            variant="solid"
            colorScheme="teal"
            ml={1}
            isLoading={renameloading}
            onClick={handleRename}
          >
            Update
          </Button>
        </FormControl>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Use defaultValue={groupChatName} attribute instead of the value attribute. You can reference the docs here...uncontrolled-components

Hope this helped 😁

about 4 years ago · Juan Pablo Isaza Report

0

You are passing undefined to the value prop in the Input component and then changing it to string on change.

Provide a initial value in useState

const [groupChatName, setGroupChatName] = useState("");
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!