Commit Graph

79 Commits

Author SHA1 Message Date
Juan Lulkin
a568c7cf18 Remove space from jsx literal and add space to function definition
According to PR comments.
2016-01-20 19:10:20 +02:00
Juan Lulkin
45834dde1c Favour stateless functions over classes when there's no state 2016-01-20 16:53:59 +02:00
Kevin Ivan
93a957f4f6 fix typo 2016-01-17 14:55:16 +01:00
Simen Bekkhus
96ef087bdf Allow multiple stateless components in a single file 2016-01-07 19:22:18 +01:00
Austin Witherow
fd6867d964 missing 's', create(s) under Method 2016-01-04 16:19:24 +01:00
Iurii Kucherov
bbaaf746db Add missing back tick 2015-12-29 22:54:02 +01:00
Jordan Gensler
e12e5f0480 Removing name prefix rules. 2015-12-23 14:57:22 -08:00
Jordan Gensler
ae69188304 Removing file extensions. Fixing typos. 2015-12-23 14:57:22 -08:00
Jordan Gensler
5c3137d736 Cleaning up the react styleguide. Adding additional info in props. 2015-12-23 14:57:22 -08:00
Joe Lencioni
474087c426 [readme] Use consistent whitespace in react readme
I noticed that some newlines and indentation were a little inconsistent
in this file, so I decided to smooth things out a bit. This should help
people who decide to modify this document in the future. When
determining which is the "right" way to format these things, I decided
to use the style used by base readme as a guide.
2015-12-23 10:12:42 -08:00
Joe Lencioni
a7d3e02a77 [readme] Add missing heading to react TOC
I noticed that this heading wasn't listed in the table of contents.
Adding it will help people see at-a-glance what they might find in this
document.
2015-12-23 10:12:42 -08:00
Joe Lencioni
450e64c9d2 [readme] Add backticks around code items in react readme
I noticed a number of places in this document where code was being
referenced but it was not marked as such. Adding backticks will instruct
the markdown parser to format these bits as code, which should improve
the readability of this document.
2015-12-23 10:12:42 -08:00
Joe Lencioni
055aa14518 [readme] Clean up isMounted section in react readme
When I added this section in f2dc5043a I didn't do a very good job of
following the style used in other parts of this repo. This commit
remedies that.
2015-12-22 22:46:25 -08:00
Joe Lencioni
f2dc5043a1 [eslint-config] [minor] Enable react/no-is-mounted rule
isMounted is an anti-pattern [0], is not available when using ES6
classes, and is on its way to being officially deprecated.
eslint-plugin-react recently added the react/no-is-mounted rule in
3.12.0 that prevents its use.

[0]: https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html

Finishes #633
2015-12-22 12:04:03 -08:00
Billy Janitsch
bbcb1371e5 Remove deprecated react/jsx-quotes 2015-12-15 15:59:40 -05:00
Jordan Gensler
e9b1ef92bf Adding links to lint rules in react styleguide. 2015-12-11 23:00:10 -08:00
Maja Wichrowska
efe7507e65 export default should not be inline with the class declaration
When there are static variables like `propTypes` and `defaultProps`, we shouldn't export them until we have actually set them onto the `Component`. This may change if the current ES7 proposal for static class properties gets accepts, and we update to support it.
2015-10-20 17:31:01 -07:00
Kevin Cooper
ef7fbea3d9 Add further reasoning for using double quotes in JSX 2015-10-01 16:53:49 -07:00
Kevin Cooper
d4f69efeec Add reasoning for using double quotes in JSX 2015-10-01 15:11:17 -07:00
Jake Teton-Landis
c42275f5dd Merge pull request #491 from gilbox/react-terse-export-syntax
[react] inline export syntax
2015-09-16 16:08:56 +09:00
Jordan Harband
3307caf5a0 do not export propTypes
We decided to stick with the decision to not export `propTypes`, and leave them as only a static property on the default export.

/@josh-perez @gilbox
2015-08-28 13:57:30 -07:00
Gil Birman
1733557ac4 [react] inline export syntax 2015-08-28 11:15:32 -07:00
Dace Willmott
933b367e6c update spelling to clarify JSX rather than JS 2015-08-27 14:51:24 -04:00
Jordan Harband
c4fdbc2742 Recommend exporting propTypes as a named export
By exporting `propTypes` as a named export *as well* as attaching them to the "class", they can be explicitly imported by tests and other components in a way that aligns with the future ES6 module dependency graph, rather than as an arbitrary property that isn't statically verifiable. Doing both is great imo.

Thoughts?
2015-08-17 20:42:58 -07:00
Josh Perez
4b70374b9c Update React style guide with new rules
This formalizes the rules that we've been following for class extends React.Component and also updates our ordering with whats in the eslintrc file.
2015-07-16 10:42:26 -07:00
Horace Ko
d2792f27cb Recommend using .jsx extension for React components, rather than .js. 2015-06-25 11:54:22 -07:00
ycavatars
7a7bec17f3 add missing componentDidUpdate 2015-06-08 12:56:32 +08:00
Alvin Sng
2595cb6724 removed alpha sort, changed jsx exten to js, added method prefix rule, added camelCase for props 2015-04-30 13:08:58 -07:00
Alvin Sng
3764337df2 React/JSX Style Guide 2015-04-29 15:29:51 -07:00