Of course not. The closer you get to JavaScript, the bigger mess you are going to make.
React's limitations is its greatest asset, it forces a team of engineers to stick to a common ground the must agree on: JSX, hooks, component life-cycle, etc.
React is one of the few popular libraries well known for it's lack of opinion. Every React project is different and it's hard to consolidate developers on how things should be done. If you want common ground you'd go for Angular. React is the exact opposite of common ground.
It does allow different ways of writing code and I agree that projects can be quite different architecture wise, but if I look at a component, I can be fairly certain that:
- Its return value is a some kind of UI (I know about contexts)
- Not using hooks, the variables in the JSX are side effect free
- Using hooks will trigger a state update or you can prevent one
- A re-rendered component re-renders the whole subtree
I meant that these few assumptions are shared in a project by every developer touching the project and they must work with these in mind. Abusing these will result in a rejected PR.
Can you still write bad react code? Absolutely, but at least I don't have to go back Adam and Eve to find what the hell is going on.
React's limitations is its greatest asset, it forces a team of engineers to stick to a common ground the must agree on: JSX, hooks, component life-cycle, etc.