title: TypeError: this.props.function is not a function
body: <p>First of all, I would like to say that I know there are many questions regarding this topic. I read through most of them and I double and triple checked my code but I can't seem to get it to work.</p>
  
  <p>I have the following child component, which contains an image, which you can change by clicking on said image (you can iterate through an array of 5 images).</p>
  
  <pre><code>export default class Images extends React.Component {
      constructor(props) {
          super(props);
          this.changeIcon = this.changeIcon.bind(this);
          this.state = {pointer: this.props.id-1, imgs: props.imgs };
      }
  
      changeIcon () {
          const {length} = this.state.imgs;
          const {pointer } = this.state;
          const newPointer = pointer === length - 1 ? 0 : pointer+1;
          this.setState({ pointer: newPointer });
          this.props.onChangeIcon("I work");
      }
  
      render() {
          const isclicked = this.props.clicked;
          const { pointer, imgs } = this.state;
          return(
              &lt;img src={imgs[pointer]} onClick={this.changeIcon}/&gt;
          );
      }
  }
  </code></pre>
  
  <p>This is the parent component:</p>
  
  <pre><code>import Images from "./images";
  
  class Displayer extends React.Component {
      constructor(props) {
          super(props);
          this.changeIcons = this.changeIcons.bind(this);
          this.state = {
              imgs = [link1, link2, link3, link4, link5]
          }
      }
      changeIcons(word) {
          console.log(word);
      }
  
      render () {
          return (
              &lt;div&gt;
                  &lt;Images onChangeIcon={this.changeIcons} imgs={this.state.imgs}/&gt;
              &lt;/div&gt;
          )
      }
  
  }
  </code></pre>
  
  <p>The weird thing is, that it works perfectly fine with another function inside the same child component. I used the same structure and I also double-checked for any spelling mistakes, but nothing helped.</p>
  
  <p>I still receive the same error message <code>TypeError: this.props.changeIcon is not a function</code>. Am I missing something? Can anyone spot a mistake?</p>
  
  <p>Edit: the id-prop is added at another point. In order so keep it simple I did not include that.</p>