React Component

I wanted to learn Rust and wanted to compare it to Go. So I made a simple CLI tool to generate some boilerplate react component files.

Installation

bash cargo install react-component

How To Use

bash react-component --help

bash react-component <component name> <...options>

Example

bash react-component Example --path src/components/examples

Generates three files:

```tsx import React from 'react';

export type ExampleProps = {};

export const Example: React.ComponentType = ({}) => { return (

Example renders
); }; ```

```tsx import { screen, render } from '@testing-library/react';

import { Example } from './Example.component';

describe('Example', () => { it('renders', () => { render(); expect(screen.getByText(/Example renders/)).toBeDefined(); }); }); ```

```tsx import { ComponentMeta, Story } from '@storybook/react';

import { Example, ExampleProps } from './Example.component';

const story: ComponentMeta = { title: 'Example' };

export const ExampleStory: Story = (args) => { return () };

export default story; ```