Skip to content

thm-design/react-starter-2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react starter 2019

image

This project uses NPM for dependency management.

Technology

  - Emotion
  - Rebass
  - dotenv
  - Jest
  - Eslint
  - Prettier
  - Stylelint
  - Formik
  - React-Testing-Tools

Writing class components

  1. In order to produce consitent react class component code, add React APIs at the top, and custom methods below the render()
Note: With the new Hooks API coming soon, it probably makes sense write function components more, in general.
  class MyComponent extends PureComponent {
    statics
    lifecycles
    state
    render()
    ------
    MyMethod1
    MyMethod2
    ...
  }
  1. Use PureComponent by default unless you need to optimize manually with shouldComponentUpdate 99% of the time we should be using PureComponent for class components.

  2. Add a displayNames `static displayName = "MyComponent";``

  3. Be generous with comments there are various IDE plugins that can help automate it like this: Document this

  4. In prop type definitions, don't use object, array or any. During development it's fine if you are not sure what the structure is. But 90% we should be using arrayOf, shape, oneOfType etc..

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published