GitXplorerGitXplorer
s

bootstrap-component

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
69bdff5e03fa3effd993b0045668e4ae7f6d61ab

Add a badge

committed 6 years ago
Unverified
6607d9c3d7323c841ae05bddb3e810fc103cb646

Update and use yarn because of reasons

committed 6 years ago
Unverified
6e5dbb8d673b91bde60a1ddb1fa750654b651355

Add component templates

committed 6 years ago
Unverified
b152bf3ecbddc05e0030b47d6635e30f7b3d3ba9

Fix markdown typo

sselbekk committed 6 years ago
Unverified
61bfd0776abe7ebd874c858af881f6b1a3a742a1

1.1.1

sselbekk committed 6 years ago
Unverified
736ac4666f6b20e9994d2b07dff0fd240f77a5f6

Add a space between imports and exports

sselbekk committed 6 years ago

README

The README file for this repository.

npm version

Bootstrap a new React component!

Why

I tend to write my React components like this:

src/
  components/
    component-name/
      index.js
      ComponentName.js

The index.js file simply works as a proxy for the component, so that you can import it like this:

import ComponentName from './components/component-name';

If you do the same, then you'll love this script!

How

You can (and should) install this tool globally:

npm install -g bootstrap-component
yarn global add bootstrap-component

You can also use npx without installing it first - if you'd like to "try before you buy":

npx bootstrap-component

Run this script from your project's root folder like this:

$ comp

You can specify the name of your component like this:

$ comp my-component

Arguments

This script is interactive, but can also be used in a scriptable way - via command line arguments.

--path

This is the path to your components folder, relative to the current folder. Default is --path=src/components.

--type

One of functionComponent, classComponent or empty Default is empty. You can also use the shorthand function or func for function components, and class for class components.

Have a feature request? Found a bug?

Please create an issue - or if you're up for it, a pull request.