Skip to content
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

setState update arrow function syntax #9476

Closed
wants to merge 2 commits into from
Closed

Conversation

hozefaj
Copy link

@hozefaj hozefaj commented Apr 21, 2017

updating the docs to remove return while using arrow functions. Also helps to keep the snippets examples in sync with other docs https://github.com/facebook/react/blob/master/docs/docs/state-and-lifecycle.md#state-updates-may-be-asynchronous

updating the docs to remove `return` while using `arrow` functions. Also helps to keep the snippets examples in sync with other docs https://github.com/facebook/react/blob/master/docs/docs/state-and-lifecycle.md#state-updates-may-be-asynchronous
@gaearon
Copy link
Collaborator

gaearon commented Apr 26, 2017

I want this section to be very explicit, so I'd rather not do it. In fact let's change it to use function here instead so that people can read it even if they're not proficient in ES6 yet. The other docs mention the function form.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comment above

@hozefaj
Copy link
Author

hozefaj commented Apr 26, 2017

Sure will make the change. But I have noticed that across the docs, there is a mix of both arrow & function form.

Personally it makes sense to use arrow function, as I think as decent JS developer should not that syntax.

using `function` to avoid confusion in case some beginner level engineer looks at the docs
@bvaughn
Copy link
Contributor

bvaughn commented Oct 8, 2017

Thank you for filing this PR!

I'm sorry to be the bearer of bad news, but the documentation and source code for reactjs.org now lives in a different repository: reactjs/reactjs.org. (For more info on why we made this move, see issue #11075.)

Would you be willing to re-open this PR on the new repo? I promise we'll review it quickly!

@bvaughn bvaughn closed this Oct 8, 2017
@hozefaj
Copy link
Author

hozefaj commented Oct 9, 2017

New docs account for arrow functions correctly. This is no longer an issue on the new docs.

@hozefaj hozefaj deleted the patch-1 branch October 9, 2017 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants