React is not available in ajax inside setState? ?

  node.js, question

clipboard.png

clipboard.png

In the getData method, if inside directly uses this. setstate ({data: [1, 2, 3, 4, 5]}), render inside can get the data, but ajax cannot be used.
My ajax is definitely available because the data can be displayed in the ajax inside console. The official website also said that it does not know what is wrong. Some people also said that it is the reason for this scope. However, the following is how react official website is written.

clipboard.png

Well, it turns out that this is no problem, and I tried setState. no problem, it can update the interface.

Well, I can see your problem. data returned by ajax is an object. react warns’ objects are not valid as a reach child’,
{} can’t output objects inside