Airbnb React/JSX Style Guide
A mostly reasonable approach to React and JSX
This style guide is mostly based on the standards that are currently prevalent in JavaScript, although some conventions (i.e async/await or static class fields) may still be included or prohibited on a case-by-case basis. Currently, anything prior to stage 3 is not included nor recommended in this guide.
Table of Contents
- Basic Rules
- Class vs React.createClass vs stateless
- Mixins
- Naming
- Declaration
- Alignment
- Quotes
- Spacing
- Props
- Refs
- Parentheses
- Tags
- Methods
- Ordering
- isMounted
Translation
This JSX/React style guide is also available in other languages:
- Chinese (Simplified): JasonBoy/javascript
- Chinese (Traditional): jigsawye/javascript
- Español: agrcrobles/javascript
- Japanese: mitsuruog/javascript-style-guide
- Korean: apple77y/javascript
- Polish: pietraszekl/javascript
- Portuguese: ronal2do/javascript
- Russian: leonidlebedev/javascript-airbnb
- Thai: lvarayut/javascript-style-guide
- Turkish: alioguzhan/react-style-guide
- Ukrainian: ivanzusko/javascript
- Vietnam: uetcodecamp/jsx-style-guide