I am new to React.js. I am trying to disable button using props value. This is how I am trying to do but its not working throwing an error Parsing error: Unexpected token, expected "...". Is it the correct way to do this? Please help me. Thanks
import React from "react";
function Note(props) {
function handleClickUpdateA() {
props.onUpdateA(props.id);
}
var dis;
if(props.des === '1')
{
dis = 'disabled';
} else
{
dis = ' ';
}
return (
<div>
<p>{props.content}</p>
<button {dis} onClick={handleClickUpdateA}>Accept</button>
</div>
);
}
export default Note;