kaivi / ReactInlineEdit

Simple React component for in-place text editing and validation
MIT License
170 stars 90 forks source link

Quality of life fixes #9

Closed masad-frost closed 8 years ago

masad-frost commented 8 years ago

Nothing major, just quality of life fixes.

Edit:

Take this pull as a proposal, you don't have to add all of these things, but some of them are warranted.

Here's a list of things that need(ed) consideration, in my opinion. In order of importance:

  1. Consistent style (and basic lint stuff)
    • spacing
    • spaces after if
    • let instead of var
    • dangling commas
    • lower case functionName
    • life-cycle methods before others, followed by render.
  2. Using defaultProps and getting rid of prop || defaultValues
  3. Class properties (since stage 0 is being utilized)
    • state = { ... };
    • get rid of binding and use property initializers
    • other initialization stuff in componentWillMount as opposed to constructor, I'm not sure about the science behind using which, but it felt more natural to drop the constructor and use react methods.