My Code Docs

My Code Docs

  • Docs
  • Projects
  • Components
  • Help

›Javascript

Javascript

  • Promises and Asnyc/Await
  • Local Storage
  • Firebase
  • JS Language Basics
  • JS Array Functions
  • Keyboard and Mouse Input
  • ES6 Cheatsheet
  • ESLint Setup
  • Data Structures
  • Naming Conventions
  • Javascript Resources
  • Javascript Snippets
  • npm Module Creation

Node

  • Node JS Basics
  • Server Config and SSH

NextJS

  • NextJS Basics

JS/React Libs

  • Lodash Library
  • Axios
  • Ramda
  • Moment JS
  • Overmind
  • Redux Forms npm Module
  • React Beautiful DnD
  • Ant Design
  • Zustand State Managment

React

  • React Basics
  • React Hooks
  • React With Classes
  • Reach Router
  • React Router
  • React Components

Redux

  • Redux in React
  • My Redux Pattern
  • Redux with React (First Doc)
  • Simple Redux Package

ReactNative

  • React Native
  • React Navigation V5
  • React Navigation V4

HTMLCSS

  • HTML and CSS Snippets
  • Tailwind CSS

Electron

  • Electron React Boiler
  • Electron Basics
  • Electron Packaging
  • Electron Tooling

Naming Conventions

  • Array – use plural nouns. e.g. items
  • Number – use prefix num or postfix count, index etc that can imply a number. e.g. numItems, itemCount, itemIndex
  • Bool – use prefix is, can, has
  • is: for visual/behavior variations. e.g. isVisible, isEnable, isActive
  • can: for behavior variations or conditional visual variations. e.g. canToggle, canExpand, canHaveCancelButton
  • has: for toggling UI elements. e.g. hasCancelButton, hasHeader
  • Object – use noun. e.g. item
  • Node – use prefix node. containerNode
  • Element – use prefix element. hoverElement

Function Naming

If you are passing a function as a prop down to another component, use handleAction in the calling component and onAction in the called component:

handleClick() {
    //...do something
}

const MyComponent = (props) => {
    return (
        <div>
            <CalledComponent onClick={handleClick} />
        </div>
        );
}
← Data StructuresJavascript Resources →
  • Function Naming
My Code Docs
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2020 McCoidCo