Browse Source

Remove superfluous code in faq-functions.md example (#3293)

The sections above this describe how to use the arrow function to bind functions to the component instance to avoid explicit binding in the constructor. This example though, uses both the arrow function and explicitly binds the function. I realise the point of this particular example isn't to describe the binding process, but considering the sections that immediately proceed it, I think it'd be good to avoid confusion here.
main
Andrew Beaven 4 years ago
committed by GitHub
parent
commit
df7fbff422
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      content/docs/faq-functions.md

1
content/docs/faq-functions.md

@ -152,7 +152,6 @@ const A = 65 // ASCII character code
class Alphabet extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.state = {
justClicked: null,
letters: Array.from({length: 26}, (_, i) => String.fromCharCode(A + i))

Loading…
Cancel
Save