-
Notifications
You must be signed in to change notification settings - Fork 26.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added some changes in react readme file #2625
base: master
Are you sure you want to change the base?
Conversation
d723c7e
to
7bdde30
Compare
@@ -29,6 +29,9 @@ This style guide is mostly based on the standards that are currently prevalent i | |||
- 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/yannickcr/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`. | |||
- Consider not using React memo,useMemo and useCallback hooks in the code unless there is no way to write the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? These hooks are critically important and should often be used - see https://attardi.org/why-we-memo-all-the-things/
@@ -29,6 +29,9 @@ This style guide is mostly based on the standards that are currently prevalent i | |||
- 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/yannickcr/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`. | |||
- Consider not using React memo,useMemo and useCallback hooks in the code unless there is no way to write the code. | |||
- React specific file names should start with Capital letter where as Javascript specific file name can start with small letter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutely not; capitalization of values and filenames has nothing to do with React, and is a JavaScript-wide convention.
@@ -29,6 +29,9 @@ This style guide is mostly based on the standards that are currently prevalent i | |||
- 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/yannickcr/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`. | |||
- Consider not using React memo,useMemo and useCallback hooks in the code unless there is no way to write the code. | |||
- React specific file names should start with Capital letter where as Javascript specific file name can start with small letter. | |||
- Try to write folder specific components,so its easy to navigate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on this?
```filenames in React | ||
// bad | ||
header.jsx | ||
|
||
//good | ||
Header.jsx | ||
|
||
|
||
```filenames in Javascript | ||
//bad | ||
Header.js | ||
|
||
//good | ||
header.js | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this; this is not a good thing to recommend nor will the airbnb guide likely ever recommend it.
No description provided.