Fix reusable react components duplicate id... dumbass

This commit is contained in:
TukanDev
2022-07-04 04:14:35 +02:00
parent 29716c43b6
commit 9ea92a23ee
11 changed files with 32 additions and 67 deletions

View File

@@ -40,10 +40,10 @@ export default class Checkbox extends React.Component<IProps, IState> {
render() {
return (
<div className="Checkbox" id="commonCheckboxContainer">
<div className="Checkbox">
<input type='checkbox' id={this.props.id} checked={this.state.checked} onChange={this.handleChange} />
<label id="commonCheckboxLabel" htmlFor={this.props.id}>
<div className="CheckboxDisplay" id="commonCheckboxDisplay">
<div className="CheckboxDisplay">
{this.state.checked ? <img src={checkmark} alt='Checkmark' /> : null}
</div>
<span>{this.props.label || ''}</span>