Javascript 反应:按组件中的值筛选多维数组对象

Javascript 反应:按组件中的值筛选多维数组对象,javascript,reactjs,multidimensional-array,ecmascript-6,Javascript,Reactjs,Multidimensional Array,Ecmascript 6,我有这样一个对象数组: var matchs = [ { id: 10689, sport: 'Tennis', players: [ { id: 22, name:'Rafa Nadal', country: 'Spain', odds: { bookie_1: 1.60, bookie_2: 1.61,

我有这样一个对象数组:

var matchs = [
    {
      id: 10689,
      sport: 'Tennis',
      players: [
        {
        id: 22,
        name:'Rafa Nadal',
        country: 'Spain',
        odds: {
            bookie_1: 1.60,
            bookie_2: 1.61,
            bookie_3: 1.62
          }
        },
        {
        id: 23,
        name:'Roger Federer',
        country: 'Spain',
        odds: {
            bookie_1: 2.30,
            bookie_2: 2.31,
            bookie_3: 2.32
          }
        }
      ]
    },
    {
      id: 12389,
      sport: 'Tennis',
      players: [
        {
        id: 45,
        name:'Fernando Verdasco',
        country: 'Spain',
        odds: {
            bookie_1: 3.20,
            bookie_2: 3.21,
            bookie_3: 3.22
          }
        },
        {
        id: 65,
        name:'Andy Murray',
        country: 'Spain',
        odds: {
            bookie_1: 1.20,
            bookie_2: 1.21,
            bookie_3: 1.22
          }
        }
      ]
    }
  ];
我有一个React组件,它显示了
map
内部
map
的所有匹配。我试过做这样的事,但没有好结果

let country='西班牙';
常量列表=({matchs})=>{
返回(
{matchs.map((匹配)=>
让my_filter=match.players.filter(player=>player.country==country);
{我的过滤器(
{match.id}
{match.players.map((player,num)=>
{player.country}>
{player.name}
)}
) : ()}
)}
);

}
可能
先过滤
匹配(按玩家所在国家),然后通过结果映射

<div>
{matchs
  .filter(match => match.players.find(player => player.country === country))
  .map(match =>
    <div className="match" key={match.id}>
      ...
    </div>
  )}
</div>

{匹配
.filter(match=>match.players.find(player=>player.country==country))
.map(匹配=>
...
)}

你能解释一下你到底想做什么吗?当你在你的对象中使用
西班牙
进行过滤时,结果应该是什么吗??