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

100
Views
A component is changing the uncontrolled value state of Select to be controlled error in ReactJS datagrid singleSelect

I hope someone will be able to help me with this problem.

I have a react datagrid table that has, as one of it's columns, a singleSelect type. The valueOptions for this column are taken from another .jsx file which returns a map, e.g. return [{"value": 'cat', "label": 'cat'}, {"value": 'dog', "label": 'dog'}];

The drop down within the column displays the values, however, when I select one of the value, say Cat 1, I get the following error:

"A component is changing the uncontrolled value state of Select to be controlled. Elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled Select element for the lifetime of the component. The nature of the state is determined during the first render. It's considered controlled if the value is not undefined."

The creation of the column is in myExample.jsx:

export default function myView() {
        const [data] = useState(getData());    
        const columns = [
        {
            field: "name",
            headerName: "Name",
            width: 100,
            type: "text",
            editable: true,
            align: 'left',
        },
        {
            field: "type",
            headerName: "Type",
            type: "singleSelect",
            width: 100,
            editable: true,
            valueOptions:  data,
            align: 'left',
        },
    ];

};

and the data comes from another file myData.jsx

export const getData = () => {
    return [{"value": 'cat', "label": 'cat'}, {"value": 'dog', "label": 'dog'}];
};

I'm new to React, so if anyone can help with this problem then I'd be very greatful.

Many thanks in advance.

about 4 years ago · Juan Pablo Isaza
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!