R
R
rgs3502018-12-24 21:53:42
React
rgs350, 2018-12-24 21:53:42

How to implement common functionality for all (several) components?

In a typical React component library, all components inherit from React.Component. But what if we suddenly needed common functionality for all components? Well, for example, the property is hidden, disabled, variation, etc. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Filippov, 2018-12-24
@rgs350

Waiting for January to release hooks, or using alpha now is the prettiest method :)
https://www.reactjs.org/hooks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question