DEV Community

Bret
Bret

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)

Collapse
 
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 bit.dev etc

And more importantly What are you trying to accomplish?

Collapse
 
yobretyo profile image
Bret

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