How do I access this Json?

1
{
    "success": {
    "data": [
      {
        "IdContribuinte": "1",
        "IdContribuinteTributario": "1",
        "IdUsuarioAnalisando": null,
        "DataAtualizacaoTributario": null,
        "DataImportacao": "2018-01-12 14:09:26.507",
        "Nivel": "0",
        "Status": "AN",
        "StatusDescricao": "ANALISAR",
        "TipoPessoa": "J",
        "TipoPessoaDescricao": "JURÍDICA",
        "Nome": "PREFEITURA MUNICIPAL DE MARILIA",
        "CpfCnpj": "44.477.909/0001-00",
        "RgIe": null,
        "DataNascimento": null,
        "DataFalecimento": null,
        "Falecido": "0",
        "NomeMae": null,
        "Cep": "17501-900",
        "Endereco": "RUA BAHIA, 40 ",
        "Logradouro": "RUA BAHIA",
        "Numero": "40",
        "Complemento": "",
        "Bairro": "MARÍLIA",
        "Cidade": "MARILIA",
        "Uf": "SP",
        "Telefone": "3402-6000",
        "Email": null,
        "UsuarioAnalisando": null
      },
      {
        "IdContribuinte": "2",
        "IdContribuinteTributario": "100000",
        "IdUsuarioAnalisando": null,
        "DataAtualizacaoTributario": null,
        "DataImportacao": "2018-01-12 14:09:26.507",
        "Nivel": "0",
        "Status": "AN",
        "StatusDescricao": "ANALISAR",
        "TipoPessoa": "F",
        "TipoPessoaDescricao": "FÍSICA",
        "Nome": "JOSE ALVES FILHO",
        "CpfCnpj": "791.910.028-34",
        "RgIe": "9930556",
        "DataNascimento": null,
        "DataFalecimento": null,
        "Falecido": "0",
        "NomeMae": null,
        "Cep": "17522-270",
        "Endereco": "RUA EDUARDO PRADO, 279 ",
        "Logradouro": "RUA EDUARDO PRADO",
        "Numero": "279",
        "Complemento": "",
        "Bairro": null,
        "Cidade": "MARILIA",
        "Uf": "SP",
        "Telefone": null,
        "Email": null,
        "UsuarioAnalisando": null
      }
    ]
    "feedback_msg" => "successo"
}

I want to access this json, I get it from a react prop,

const list = this.props.list || []
console.log(list.success.data[0].Nome)

but I'm not able to access

    
asked by anonymous 11.05.2018 / 00:37

1 answer

0
console.log(action.payload.data.success.data[0])
const INITIAL_STATE = {list: []}
export default (state = INITIAL_STATE, action) => {
    switch (action.type) {
        case 'CONTRIBUINTES_FETCHED':
        console.log(action.payload.data.success.data[0])
        return { ...state, list: action.payload.data.success }
        default:
        return state
    }
}

I got the access, plus inside the taxpayerReducer file I was trying to access inside the contributor.jsx by getting the object by the props.

    
11.05.2018 / 01:55