A
A
Alexey2019-12-24 11:47:06
React
Alexey, 2019-12-24 11:47:06

What is the best approach to take when writing React code?

Good afternoon. I'm starting to learn React. Prior to that, he worked in Angular Js, Angular.
There are several questions, help to get answers to them:
1) There is a functional method of writing code and a class one. I read that classes should be abandoned in favor of functions. The official documentation describes the functional and class methods. How to use it?
2) What to use to update data - props (from parent to child) Redux, Flux or abandon everything and use hooks? (I read that state's should be avoided...)?
Perhaps I "mixed" here in terms ... I would be grateful for clarifications, I really want to choose the "right course", because I see that there are quite a few approaches to writing code.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Robur, 2019-12-24
@azovl

The library is actively developing, each new solution is designed to improve and solve the problems of the previous one. Currently, hooks are the most progressive option. And all libraries are quite actively switching to them.
So if you want to create fresh and new - take them, it will be longer possible not to rewrite for something new :)

A
Anatoly Kulikov, 2019-12-24
@anatoly_kulikov

Here is a good course , take a look, I advise.

P
Pavel Didenko, 2019-12-24
@Dasslier

I read that classes should be abandoned in favor of functions

Who said such heresy?
You have very strange sources.
In your work, you will use both a local state and receive data from props through Redux or MobX. Different situations, different solutions.
To better understand react in conjunction with redux - take a course from Yuri Bur on udemy - this is a top Russian-language course

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question