mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-30 05:14:06 +01:00
10 lines
477 B
Markdown
10 lines
477 B
Markdown
# BlitzKit
|
|
|
|
## Layout
|
|
|
|
- Hooks live in `src/hooks/useName.ts` (`.tsx` if they render JSX), one hook per file named after it, never inside a component's folder.
|
|
|
|
## TypeScript
|
|
|
|
- When an `if`/`else if` chain checks one value against several candidates (`x === "a"`, `x === b`, ...), use a `switch` on that value instead. Inside a loop, end each case with `continue`, and put the checks a `switch` can't express (`startsWith`, ranges, ...) as an `if` after it, not in `default`.
|