Skip to content

Conversation

@ankitml
Copy link
Contributor

@ankitml ankitml commented May 23, 2016

Issue reference : #3710

Before submitting a pull request, please make sure the following is done...

  1. Fork the repo and create your branch from master.
  2. If you've added code that should be tested, add tests!
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes (grunt test).
  5. Make sure your code lints (grunt lint) - we've done our best to make sure these rules match our internal linting guidelines.
  6. If you haven't already, complete the CLA.

@zpao
Copy link
Member

zpao commented May 23, 2016

I actually think that we need to do a more extensive overhaul of the tutorial to make functional and ES6 components fit more naturally.

@milesj
Copy link
Contributor

milesj commented May 23, 2016

Why use const instead of actual function declarations for stateless components? There's no context, so arrow functions are not required.

@ankitml
Copy link
Contributor Author

ankitml commented May 24, 2016

@zpao Can you be more specific? I am a beginner in React, inputs would be helpful in porting this tutorial.
@milesj - yes, that is one option. const is preferred since it is more declarative. All declarations (variables, objects, functions and function closures can be similar styled}
On Arrow functions I am not sure of my approach, I used fat arrows unless that creates a problem. I think it makes sense to be conservative in using fat arrows. I'll revert that in another commit.

@jimfb
Copy link
Contributor

jimfb commented May 24, 2016

@zpao I agree with you, but is there any harm in taking this change since it is incrementally closer to our end goal?

@zpao
Copy link
Member

zpao commented May 24, 2016

@jimfb If we end up doing a worse job of teaching React, then absolutely. We should be coordinating efforts to update the site for ES6 and make sure it's better. We should not land partial incremental updates that leave us in a state that is not better.

text: ''
}
}
handleAuthorChange = (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not handleAuthorChange() {?

Copy link
Member

Choose a reason for hiding this comment

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

Let's put a pin in this for the time being to prevent over-churn. I don't know that we will be encouraging the use of property initializers yet. We'll want to make sure we have some guidelines for code in documentation before we finalize this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should stick with the current version of JavaScript. So no property initalizers.

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2016

Hey, sorry so much for letting this get stale. This is totally my fault. 😢

We are working on revamping the docs right now. As a first phase we are merging the PRs from #3710 but unfortunately I can't merge yours because we decided to replace this tutorial with a new one written from scratch.

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.

7 participants