-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for dynamically exported components #2595
Comments
I don't recommend doing this via At Facebook, we use a system called "haste" that lets you import any file by its unique name without relative paths. I'm open to supporting it as an opt-in in CRA projects, but somebody would need to write a Webpack plugin for it. Jest already supports it. |
Jest has its own implementation of Haste. I thought Facebook dropped Haste. |
Facebook is actively using Haste in products. I think |
I'm achieving this by ejecting my app and manually resolving 'arc' paths ( I wish there was @providesModule support in CRA :) |
Going to close this as overlapping too much with #1333. |
Using atomic design and @diegohaz arc boilerplate, you are able to reference components that are located anywhere in the components subdirectories i.e. atoms, molecules, organisms etc. For reference here is the link: https://github.com/diegohaz/arc/wiki/Atomic-Design#do-not-worry
Per the link:
This is possible because all components are dynamically exported on src-example/components/index.js and imported in a way that Atomic Design structure doesn't matter:
import { Input, Label, Field, HomePage, PageTemplate } from 'components'
Has anyone been able to get the same functionality with create-react-app?
I have managed to get rid of the relative paths using .env and specifying NODE_PATH=src but I still have to explicitly include the entire subdirectory structure for the component.
Thanks
The text was updated successfully, but these errors were encountered: