Can someone help me with this code I've researched quite a lot and I'm stuck.
class App extends Component{
constructor(props){
super(props);
this.isChecked=this.isChecked.bind(this);
}
}
isChecked = (chk,sub1) => {
var btn = document.getElementById(sub1);
if (chk.checked == true) {
btn.disabled = false;
} else {
btn.disabled = true;
};
}
function App(){
return(
<form>
<div className='check'>
<input
type='checkbox'
className='checkbox'
id='termschkbx'
onchange="isChecked(this,'sub1')"
/>
<span>I agree to Terms & Conditions.<a href="" className='readme'>Read here</a> </span>
</div>
<div>
<button
type="submit"
id="sub1"
disabled='disabled'
className=" createaccount"
type="submit">CREATE ACCOUNT</button>
</div>
</form>
)
}
How to resolve this?
ERROR : Identifier 'App' has already been declared.
Is there any efficient way to do this?