Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jonorogers opened this issue Mar 22, 2016 · 3 comments

Comments

@jonorogers
Copy link

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?

@jonorogers
Copy link
Author

Annnnndddd I'm an idiot. Apologies, issues were my shitty existing select causing the stated error and not referencing the css file correctly for the weird display issue.

@ManuelKu1223
Copy link

<select className='Input--BorderBottom is-radiusless is-shadowless Font--Gray'> <option defaultValue disabled> Select Sexo </option> <option defaultValue selected> Masculino </option> <option defaultValue> With options </option> </select>

Warning: Use the defaultValue or value props on instead of setting selected on .

@Rall3n
Copy link
Collaborator

Rall3n commented Mar 31, 2019

@react1130 From the code you provided I can see that you problem has nothing to do with this library. You are using the standard React implementation of the html select input. Please try searching for a more related information source revolving around your error. StackOverflow might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants