title: why I can not use function keyword to define a function inside a reactjs class
body: <p>I have been confused about some syntaxes in ReactJS, one is that when I define a function inside one Reactjs class, I can not use function keyword, but when I moved the function outside the class then I have to add keyword function before the signature. Second is that if I write a function inside the render(), then I have to use arrow function. For example, why the following is wrong:</p>
  
  <pre><code>class Test extends Component{
     constructor(props){
        super(props)
     }
     function test(){
       //this is wrong,I need to remove function keyword
     }
  
     render(){
       mytest(){
        //also this is wrong,I only can use arrow function
       }
     }
  } 
  </code></pre>