I have a number input in a form like follows :
<input
type="number"
id="weight"
onChange={this.handleChange}
value={this.state.weight}
placeholder="Enter weight…"
/>
How can I have a placeholder phrase display on it ?
If I initialy set this.state.weight to value 0, then no placeholder displays.
If I set it to null the placeholder displays but get this ugly warning
Warning:
valueprop oninputshould not be null. Consider using an empty string to clear the component orundefinedfor uncontrolled components.