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.
bash
cargo install react-component
bash
react-component <component name> <...options>
bash
react-component Example -p src/components/examples
Generates two files:
src/components/examples/Example.component.tsx
```tsx import React from 'react';
type ExampleProps = {};
export const Example: React.ComponentType
src/components/examples/Example.component.test.tsx
```tsx import { screen, render } from '@testing-library/react';
import { Example } from './Example.component';
describe('Example', () => {
it('renders', () => {
render(
expect(screen.getByText(/Example renders/)).toBeDefined(); }); }); ```
bash
react-component --help