lundi 1 février 2021

How to create *re-usable* react components?

As I know, a react app project consist of many components such as navbar, login-form, gallery, etc. And each component may consist of a smaller components such as button, input.

My question is how to decouple each component as standalone projects and register them in a registry such as npm: @my-app-org/component-foo, @my-app-org/component-awesome.

So in the future if I create a complete web app, i just import the component i was made or create a new one from already built components. Thus i can build the app quickly.




Aucun commentaire:

Enregistrer un commentaire