C
C
Cerebrumlab2019-02-08 16:08:40
Iron
Cerebrumlab, 2019-02-08 16:08:40

Redux how to read nested object property?

good afternoon, there is an object of the view

{
  "id": 6,
  "leadcreatedate": "0001-01-01T00:00:00Z",
  "leadmodifydate": "0001-01-01T00:00:00Z",
  "utm": {
    "uid": {
      "Int64": 1,
      "Valid": true
    },
    "domainsource": {
      "String": "http://site.ru",
      "Valid": true
    },
    "urlsource": {
      "String": "http://site.ru",
      "Valid": true
    }
   
  }
}

In the stateStore, I see all the data, everything is written perfectly, but I can’t read the nested UTM object
this.props.test.utm - outputs an object with data
this.props.test.utm.uid to the console - TypeError: Cannot read property 'uid' of undefined
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Константин Цветков, 2016-07-24
@tsklab

Радиатор видео горячий - держать палец невозможно
Это перегрев — чистите вентилятор, уберите программы "оптимизации" охлаждения или соответствующие настройки в драйвере (BIOS видео тоже) приведите в состояние по-умолчанию..

Александр Алексеев, 2016-08-08
@shure348

проблема с чипами видеопамяти 100%

A
Andrey Okhotnikov, 2019-02-08
@tsepen

Perhaps you are trying to read it before the data has arrived (on the first render), you can make a condition - if such an object exists - output the data.
This happens when you make a request to the server in the componentDidMount method, the render has already worked, and you only requested the data after that. Then the data will be received, the props will be updated, the second render will be called already with the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question