Why am I getting Warning: Functions are not valid as a React child?

前端 未结 2 903
野的像风
野的像风 2021-01-18 04:20

When I try to call a method which returns the result of the map method, I get the following error Warning: Functions are not valid as a React child. This may happen if

2条回答
  •  感情败类
    2021-01-18 04:49

    this.renderAlbums refers to the actual function itself, whereas this.renderAlbums() actually executes the function and thus represents the function's return value.

提交回复
热议问题