React Cli to Generate Components

React Cli to Generate Components

rc-generate .React CLI to generate components ( Reactjs + React Native)

rc-generate

React CLI to generate components ( Reactjs + React Native)

Install

npm

npm install rc-generate --save-dev

yarn

yarn add rc-generate --dev

Use in project

package.json

{
  "scripts": {
    "rcg": "rc-generate"
  },
  // Config with package.json
  "rc-generate": {
    "appDir": "src",
    "typescript": true,
    "reactNative": false
  },
}

Config with project -> rc-generate.config.js

const styles = `
.container {
  color: red;
}
`;
const actions = `
const getTodo = () => {
  return {
    type: 'GET_TODO',
    payload: {}
  }
}
`;
const reducers = ``;
const sagas = ``;
const thunks = ``;

const config = {
  appDir: 'src',
  typescript: true,
  reactNative: false,
  templates: {
    styles,
    actions,
    reducers,
    sagas,
    thunks
  }
}
module.exports = config;

cli:

npm run rcg --style scss --redux saga --component:name components/Button --component:type class

or:

yarn rcg --style scss --redux saga --component:name components/Button --component:type class

or npm global

npm install rc-generate -g

Use with npx

npx rc-generate --app-dir user/projectName/src --style scss --redux saga --component:name components/Button

Use with npm global

rc-generate --app-dir user/projectName/src --style scss --redux saga --component:name components/Button

Options

Option Type Default Description
-d, --app-dir string - The name of the application directory
-c:type, --component:type function, class function Generate a component type ( example: Button or components/Button)
-c:name, --component:name string - Generate a component name
-s, --style css, scss, react-native - Generate a style
-r, --redux thunk, saga - Generate a redux state management
-V, --version - - output the version number
-h, --help - - display help for command

Download Details:

Author: wiloke1

Source Code: https://github.com/wiloke1/rc-generate

react reactjs javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Increase Performance of React Applications Via Array JavaScript Methods

Increase Performance of React Applications Via Array JavaScript Methods. We will create a simple event management application in the react to add, update, and delete an event.

Routing in React without React-Router

I have been using React JS in my projects for quite some time now and am used to managing routing in my app using the react-router package. I have always been keen on having as little dependencies in my apps as possible, so, I always felt perturbed by the use of this particular package in simpler apps which did not have complex routes.

The Ugly Side of React Hooks

In this post, I will share my own point of view about React Hooks, and as the title of this post implies, I am not a big fan.

ReactJS: The Javascript Developer’s Guide

This article will walk you through the concepts you would need to know to step into the world of widely used ReactJS.