How to deal with the json data obtained in react.

I have obtained a json data and want to merge the same ones together. For example, there are two stores in Pudong New area in the picture, and all the stores are shown under the area name.

clipboard.png
here is my code:

import React,{Component} from "react"
import "./Cinemalist.css"
import {connect} from "react-redux"
import axios from "axios"

class Cinemalist extends Component{

    componentDidMount(){
        this.props.getCinemalist()
    }

    render(){
        return(
            <div id="cinemalist">
                <ul className="cinemalist-ul">
                    {
                        this.props.mylist.map(item=>
                            <li key={item.id}>
                                <p className="title">{item.district.name}

<div className="cinema"> <h4 className="cinema-name">{item.name}</h4> <p className="cinema-add">{item.address}

</div> </li> ) } </ul> </div> ) } } export default connect( (state)=>{ return { mylist:state.cinemalistReducer } },{ getCinemalist:()=>{ return (dispatch)=>{ axios.get("/v4/api/cinema?__t=1529633184561").then(res=>{ console.log(res.data); dispatch({ type:"getcinemaData", payload:res.data.data.cinemas }) }) } } } )(Cinemalist)

data uses deep replication:

var cinemalist = (prevstate=[],data={})=>{
    let {type,payload} = data;

    switch(type){
        case "getcinemaData":
            return [...prevstate,...payload];
        default :
            return prevstate;
    }
    return prevstate;
}

export default cinemalist
Mar.21,2021

can you give me the data structure?


the current data structure is an array, which can be looped, and the item of the same area is stored in an array. The data structure changes from an one-tier array to a two-tier array, and then you can display

on the page.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37cce-2b90c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37cce-2b90c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?