Skip to content

Warning: Use the defaultValue or value props on <select> instead of setting selected on <option> #845

@jonorogers

Description

@jonorogers

Hi man, component looks great but I can't get even a simple test case to run.

Test code:

var Select = require('react-select');

var options = [
    { value: 'one', label: 'One' },
    { value: 'two', label: 'Two' }
];

render: function () {

        return (
            <Select 
                    name='whatever'
                    options={options}
                    value='one'
            />
        );
    }

Renders the first option on one line (as text), then a tiny input (1 character) below it with an x next to it, and gives the title warning in the console. Is this to do with the 1.0.0 changes? NPM installed 0.9.1, dependencies seemed to resolve fine (they're sitting in my node_modules, anyway). Packages.json only includes 'react-select' as a dependency, not the other two.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions