|
|
|
|
|
by philliphaydon
1205 days ago
|
|
JSX forces you into small tiny components because anything of any decent size becomes unmanageable. There's way too much mixing of JS into the template. Vue you can do <button :disabled="!isFormValid">Submit</button>
In React I've seen people do: if (!props.isFormValid) {
return <button>Submit</button>;
}
return <button disabled="disabled">Submit</button>;
This is just an example, obviously you can write this better in React. My point is there's /always/ so much conditional markup like this in every react project I've come across or worked on.Edit: I donno how to format code on here sorry. (oh figured it out, bunch of spaces) |
|
In JSX, the "disabled" attribute is a boolean; so it would be just: