Unable to create component in a different path using @nrwl/react
See original GitHub issuePlease 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.
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)
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 the components 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 string components/hello is attached to the variables, looking like this:
import React from 'react';
import './components/hello.css';
/* tslint:disable:no-empty-interface */
export interface Components/helloProps {
}
export const Components/hello = (props: Components/helloProps) => {
return (
<div>
<h1>Welcome to components/hello component!</h1>
</div>
);
};
export default Components/hello;
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.
- generate a react workspace
- generate a component with other path via
ng g c differentPath/componentName - …
Context
Please provide any relevant information about your setup:
- Angular CLI version 8.1.1
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
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
@mehrad-rafigh I found it easier to run
yarn e2e react(you don’t have to let it run fully), and then playing with the generated workspace intmp/nx/proj.Or else you can
yarn buildand manually copy thebuild/packages/reactfolder over to your workspace’snode_modules.whats solution?