Use defaultValue

This commit is contained in:
Chris Blanchard 2015-09-15 17:11:52 +01:00
parent b7aaa08e4b
commit f12b19a90f
1 changed files with 5 additions and 6 deletions

View File

@ -142,18 +142,17 @@ var ProfileModal = React.createClass({
let division = this.props.user.profile.skill;
let skillLevels = ["Low Skill", "Medium Skill", "High Skill"].map(skill => {
if (skill === division) {
return <option selected="selected" key={skill}>{skill}</option>
} else {
return <option key={skill}>{skill}</option>
}
return <option key={skill}>{skill}</option>
});
return (
<form>
<div className="form-group">
<label>Player Skill</label><br />
<select className="form-control" ref="playerskill">
<select
defaultValue={division}
className="form-control"
ref="playerskill">
{skillLevels}
</select>
<p><small>Try to give an accurate representation of your skill to raise the quality of your gathers</small></p>