DEV Community


Posted on

REACT, reusable Components, best way to understand the layout?

What’s the best way to understand the way you setup and reuse components? So far, allot of tutorials have a functioning component, but they didnt setup the “useState” yet, or “setState”

Top comments (2)

dance2die profile image
Sung M. Kim

Hi Bret. What'd be your scope of "re-usability"?

Within a project? Create a new file and import it.

Within a mono-repo? Link the project (Lerna, npm/yarn workspaces)
Across different projects? You might want to "npm/yarn link" or create NPM packages and import or use etc

And more importantly What are you trying to accomplish?

yobretyo profile image

“Re usable” components. That’s what react or any framework is about?