+ 2
Why react code is very complex?
I tried to learn react but and created a counter it took about 15 lines but in angular It took only 2-3 lines?
35 Antworten
+ 20
Show your 2 line angular and 15 lines react, then we can making judgements.
I can make react counter in 1 line.
+ 8
Vinayak I think this is where I would like to stop you.
If you like angular then stick with it and if you like react then stick with it.
What you're doing is wasting time comparing React and Angular.
+ 7
Vinayak
I have worked on both Angular and React enterprise level applications , I find Angular appealing in terms of completeness , it has got everything observables to handle async state , dependency injection, reactive forms and what not , but in React I particularly like the simplicity , compare the lifecycle of both Angular and React and you will know what I mean, apart from that state management is pretty solid in React with react-redux , well that can also be implemented in Angular , since its an concept but I have not seen it yet...
One more thing is you break down your code in components so everything in code is manageable.
React is definitely better for individuals who know just JS (*ES6 **wink**)
Where as for Angular , you will need to know Typescript......
Just a suggestion use functions in ReactJS for components
+ 4
const Counter = () => {
[counter, setCounter] = useState(0)
increment = () => setCounter(counter++)
}
This is react
+ 3
I don't know angular, because their code is very complex.
+ 2
Now you are saying angular is complex i think it is easier than react
+ 2
Angular is more complex than react
+ 2
React is easier than angular
+ 2
Have you tried to write angular code in cli also very simple
+ 2
I'd used angular for 6 months, before switched to react. I never look back once i know react.
+ 2
Really
+ 2
I have also used react for 2 months state management is time consuming but in angular it is easy because it creates all tasks by itself
+ 2
React Hook won't confuse you
+ 2
Have you created a database in angular with use of nestjs and typeorm
It's very easy tell me about react
+ 1
Ok
+ 1
class Counter extends React.Component {
state = {
counter: 0
}
increment = () => {
this.setState({
counter: this.state.counter+1});
}
render() {
return <div>
<p>{this.state.counter}</p>
<button onClick={this.increment}>Increment</button>
</div>;
}
}
This is react
+ 1
export class appcomponent {
counter =0;
increment() {
this.counter++;
}
}
This is angular
+ 1
But what about angulat
+ 1
Have you tried to write react code in hooks also very simple
+ 1
Yes I have tried
When code become heavy it becomes confusing