I am making facebook messenger clone using reactjs but this error stops my working as application was running smoothly but unfortunately this error stuck me.
{
messages.map(messages => (
<Message username={userName} message={messages} />
))
}
First of all map() function use for JS array, that's why be sure messages is array, after that if messages is array but it is null in this case you get this error. in addition you can check this question React Uncaught TypeError: this.state.messages.map is not a function