Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This style guide is mostly based on the standards that are currently prevalent i
## Basic Rules

- Only include one React component per file.
- However, multiple [Stateless, or Pure, Components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) are allowed per file. eslint: [`react/no-multi-comp`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md#ignorestateless).
- However, multiple [Stateless, or Pure, Components](https://legacy.reactjs.org/docs/components-and-props.html#function-and-class-components) are allowed per file. eslint: [`react/no-multi-comp`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md#ignorestateless).
- Always use JSX syntax.
- Do not use `React.createElement` unless you’re initializing the app from a file that is not JSX.
- [`react/forbid-prop-types`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md) will allow `arrays` and `objects` only if it is explicitly noted what `array` and `object` contains, using `arrayOf`, `objectOf`, or `shape`.
Expand Down Expand Up @@ -75,7 +75,7 @@ This style guide is mostly based on the standards that are currently prevalent i

## Mixins

- [Do not use mixins](https://facebook.github.io/react/blog/2016/07/13/mixins-considered-harmful.html).
- [Do not use mixins](https://legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html).

> Why? Mixins introduce implicit dependencies, cause name clashes, and cause snowballing complexity. Most use cases for mixins can be accomplished in better ways via components, higher-order components, or utility modules.

Expand Down Expand Up @@ -454,7 +454,7 @@ We don’t recommend using indexes for keys if the order of items may change.
- Spreading objects with known, explicit props. This can be particularly useful when testing React components with Mocha’s beforeEach construct.

```jsx
export default function Foo {
export default function Foo() {
const props = {
text: '',
isPublished: false
Expand Down Expand Up @@ -735,7 +735,7 @@ We don’t recommend using indexes for keys if the order of items may change.

> Why? [`isMounted` is an anti-pattern][anti-pattern], is not available when using ES6 classes, and is on its way to being officially deprecated.

[anti-pattern]: https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
[anti-pattern]: https://legacy.reactjs.org/blog/2015/12/16/ismounted-antipattern.html

## Translation

Expand Down
Loading