Last active
July 21, 2023 01:35
-
-
Save taichi0514/106f1f99cc7d13566e02d23e1086f06d to your computer and use it in GitHub Desktop.
ScaffdogでComponentやHookファイルのテンプレート生成させる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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