snaerth/create-react-component-folder

The "path" argument must be of type string. Received undefined

diemax opened this issue ยท 1 comments

Hello! Great project ๐Ÿ˜„

When I try to run

$ npx crcf --createindex

I get this error:

The "path" argument must be of type string. Received undefined
This happens either if I run the command in the root folder where components/ folder is or inside components/

I followed the instructions and I installed the package running:

$ npm install --save-dev create-react-component-folder 

Any thoughts? ๐Ÿ˜„

Thank you!

@diemax Thank you for your great compliments. Nice to hear that someone is using it :)

So the docs aren't so clear for using this feature. What you will have to do is to first create your components inside let's say a directory called /components.

You can run

npx crcf components/Home About Contact

And that will create a components folder and those three components like you can see in the image below

image

Next you can run

npx crcf --createindex components

Which will create the index.js file in the root of the components directory
image

And there you this is what the index file will look like

image