-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to create component in a different path using @nrwl/react #1702
Comments
@nrwl/react
I am trying to debug this, but I do not get how to start my new react component schematic. I ran |
@cafesanu There seems to be a bug with not normalizing the component file name (which we can fix). As for folder structure, we may want to move that to a separate So if you run
|
@mehrad-rafigh I found it easier to run Or else you can |
@jaysoo Thank you! Since this is a command that we would use a lot, could it have a short name and a shorthand?maybe Thanks again! |
would this also include nested directories? something like |
Yes! I'll make sure that works and remove any rough edges around the CLI. |
Of course! We can use |
When provided, component will be generated in the directory. e.g. src/lib/some-directory/my-component.tsx Closes nrwl#1702
Also adds alias support to tao cli. Closes nrwl#1702
Also adds alias support to tao cli. Closes nrwl#1702
Also adds alias support to tao cli. Closes nrwl#1702
Also adds alias support to tao cli. Closes nrwl#1702
PR has been opened #1729. Also adding an error message when you use slashes in component name. e.g.
results in an error
|
Also adds alias support to tao cli. Closes #1702
whats solution? |
Below command works for me nx g @nrwl/react:component test --directory=components/hello --project=frontend components/hello will be generated inside the src component |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Please make sure you have read the submission guidelines before posting an issue
Prerequisites
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
First of all, I'd like to thank you! I love to see that you are investing in react!!
Expected Behavior
When using
ng generate component
(via@nrwl/react
schematics) with a path other than the default, the component should is created in a weird path.Please describe the behavior you are expecting
ng generate component components/hello
should create a component in thecomponents
directory. This is the default behavior for native Angular CLI if you want to create components or services in another path. The final result should look like this:Additionally, when trying to run
ng g c components/hello
, the stringcomponents/hello
is attached to the variables, looking like this:Current Behavior
What is the current behavior?
As mentioned above, components get created in the wrong path, and the path name is attached to variables
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
ng g c differentPath/componentName
Context
Please provide any relevant information about your setup:
A minimal reproduce scenario using allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.
Failure Logs
Please include any relevant log snippets or files here.
Other
The text was updated successfully, but these errors were encountered: