As Robin has alluded to you can have a common folder. I in fact have a fairly large common folder, broken down into sub-features - e.g. common/buttons. I also don't like the index.js approach as someone else has mentioned so I would have common/buttons/SaveButton.js, common/buttons/CancelButton.js etc. Then one index.js file in buttons to export these.
For common you can even then add a webpack alias so you can import these from anywhere without lots of ../../, e.g. import { SaveButton } from "@common/buttons";
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As Robin has alluded to you can have a common folder. I in fact have a fairly large common folder, broken down into sub-features - e.g.
common/buttons
. I also don't like theindex.js
approach as someone else has mentioned so I would havecommon/buttons/SaveButton.js
,common/buttons/CancelButton.js
etc. Then oneindex.js file
in buttons to export these.For common you can even then add a webpack alias so you can import these from anywhere without lots of
../../
, e.g.import { SaveButton } from "@common/buttons";