Skip to content

Instantly share code, notes, and snippets.

@taichi0514
Last active July 21, 2023 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taichi0514/106f1f99cc7d13566e02d23e1086f06d to your computer and use it in GitHub Desktop.
Save taichi0514/106f1f99cc7d13566e02d23e1086f06d to your computer and use it in GitHub Desktop.
ScaffdogでComponentやHookファイルのテンプレート生成させる
---
name: 'component'
root: '.'
output: '.'
ignore: []
questions:
directory: 'Please enter directory path.'
name: 'Please enter a component name.'
---
# `components/{{ inputs.directory | pascal }}/{{ inputs.name | pascal }}.tsx`
```ts
import type { FC } from 'react';
type Props = {
text: string;
};
export const {{ inputs.name | pascal }}: FC<Props> = ({ text }) => {
return <>{ text }</>;
};
```
# `components/{{ inputs.directory | pascal }}/index.ts`
```ts
export { {{ inputs.name | pascal }} } from './{{ inputs.name | pascal }}';
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment