/sfc

Rust CLI for scaffolding React SFCs.

Primary LanguageRust

stateless-function-component

Easy scaffolding of stateless function components.

Supported:

  • Plain SFC
  • --styled: Styled Components
  • --routed: React Router
  • --feather: Feather Icons
  • --children: Nested Components

All options can be mixed and combined.

Usage:

# show all options
sfc --help

# scaffold styled sfc with routing
sfc --styled --routed

Example output for sfc --styled --routed:

import React from 'react';
import styled from 'styled-components';
import {
    Link,
    Switch,
    useRouteMatch,
} from 'react-router-dom';

const MyComponent = ({className}) => {
    const {path} = useRouteMatch();

    return (
        <div className={className}>
        </div>
    );
};

export default styled(MyComponent)``;