Take a look at this example.
export const Foo = () => { const [state, setState] = useState(0) return ( <div> <input type="button" value="" {state === 0 ? disabled : ""}/> </div> ) } I'm trying to make the button disabled if state is equal to 0 and if not then the button will not be disabled. I don't know what is wrong and why it gives me this error: '...' expected
没有评论:
发表评论