Gallery
Donkey Development Guide
Share
Explore
Coding guide

icon picker
Naming Practices

General Naming

Use context naming where we think of the name as a combination of his self name and higher containing folders.

Examples

// Good
Templates > Profile.tsx

// Bad
Templates > ProfileTemplate.tsx

Naming Components, hooks & functions

Component folder names should be PascalCase e.g CardImage, HeaderWithInfo,etc
Component files should be named index.tsx (so we can import them shortly).
Hooks name should be camelCase e.g useIsomorphicEffect, useTabs, etc
Functions for example helper functions and event handler function will also be camelCase e.g waitFor, calculateRoi, etc
Prop names and state variables should be camelCase.

Examples:

// Good
Navbar/index.tsx

// Bad
Nabar/Navbar.tsx

Naming Props

Give props clear and meaninful names so a developer that don’t know the system will understand what is there purpose.

Examples:

// Good
desktop={6} mobile={12}

// Bad
xl={4} l={6} sm={12}
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.