Skip to content
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

Add Generating new Component section to User Guide #2685

Closed
wants to merge 2 commits into from
Closed

Add Generating new Component section to User Guide #2685

wants to merge 2 commits into from

Conversation

diegohaz
Copy link

@diegohaz diegohaz commented Jun 29, 2017

Related to #2482, #1242 and #1886

Generating new Component

Instead of creating component files by hand, you can use generact to generate new components based on existing ones.

Showing generact usage

Optionally, you can add it to devDependencies (yarn add --dev generact) and add an npm script to easily generate new components based on another specific one (e.g. src/components/MySimpleBaseComponent/MySimpleBaseComponent.js):

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
+   "component": "generact src/components/MySimpleBaseComponent/MySimpleBaseComponent.js"
  }

Then, just run yarn component.

@stale
Copy link

stale bot commented Nov 2, 2018

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 2, 2018
@stale
Copy link

stale bot commented Nov 7, 2018

This pull request has been automatically closed because it has not had any recent activity. The conversation will be locked in 7 days unless the pull request is reopened. Thank you for your contribution.

@stale stale bot closed this Nov 7, 2018
@diegohaz diegohaz deleted the patch-1 branch November 7, 2018 23:37
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants