Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
I am aware that React’s official documentation states that there's no plan to deprecate class components any time soon. But, according to some website and article, the class components are going to obsolete.
There is no plans to remove class components. Library developers recommend use functional components in new code.
You can write functional or class components if you can keep code clean and easy to understand for any develop.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 months ago.
Improve this question
I'm a newbie to react.js and i don't know class components.I'm trying hard to understand the react life cycle.
If you need info on React life cycle methods for class components, check here: https://reactjs.org/docs/state-and-lifecycle.html
If you need info on React functional components check here: https://reactjs.org/docs/hooks-overview.html
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
When we have component to write all logic then why we use redux. As we can separate template and styling from component
In the simplest words, you need redux for very complex state management in a large project. When you work on a large production level project, there are several components and states to worry about, and passing components between states becomes a mess. You could use context but in many cases you may need to move state up by 1 or more components to be able to use it effectively. This kind of problem is what redux aims to solve, and you will not be able to appreciate unless you work on a large project where components depend on other component's states.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I see lot of articles stating that Proptypes in React components are useful for validation. But are there any use cases, where we should not use Proptypes? Or should we always use them?
PropTypes are suggested by React developers and mentioned in the official documentation page as well. I don't think there is any case where we shouldn't use PropTypes as it improves the code quality.
Though if you are using TypeScript in React, then prop-types doesn't make any sense to be used.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have found some components that are not updated with the last React version, however, those components work. But I was wondering if those components are not updated would be the best option or a good practice to try to implement the libraries in React without the npm packages?
Thanks.
I'm my experience, it'll depend upon the product you're working on. IE. you're working in a UI that is not likely changing and once it's done, it'll remain the same for some time (rare case), and it's not too complex. I'd go for the component even if it's not that updated.
If the benefits from constructing the component yourself (long term maintainability, extensibility, etc.) are important to your project and it won't take that much time, maybe it'll be the best option.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
For my React Dapp to call my smart contracts running on the ethereum block chain, is it better practice to use the Drizzle framework or call Web3 directly?
I recommend using drizzle because it will abstract some complexity and make your code more readable. Also check out drizzle-react it provides some components and decorators that will be super useful.
However, be careful with this type of questions in SO, it might get downvoted, since it's kind of a subjective question and people might have different opinions about it. This community is more about solving coding problems.
Best of luck.