We are developing React Components as part of product development.
Now we want other teams to reuse these components and develop something for different clients.
, eg
We have developed the UserInfo component published in the NPM repository, and other teams can use it for different clients. We do all the basic things like publishing NPM, and then developrs can point out a new component in package.json and make good use of it.
But the problem I am facing in component architecture is how a component can be designed so that they can be easily configured by other developers.
As a developer, you may have a requirement for different views, some additional methods, or override existing methods.
My approach. I feel that more improvements can be made.
Approach # 1
We wrote a Web pack plugin to replace an existing file with a newly created file at build time.
The problems are its complete replacement, so we cannot reuse or expand an existing file
Approach No. 2 - I tried to use ES6 Extend. The problem here is that we extend JS Call not "React.Component", so there is some undesirable behavior of methods and functions.
, . i. / , ..
, .
