score:0

const Holidays = ({ data }) => {
  const ListItem = (array) => {
    console.log(array);
    return array[1].events.map((item, i) => {
      return (
        <li key={i}>
          <div>title: {item.title}</div>
          <div>Date :{item.date}</div>
        </li>
      );
    });
  };
  return (
    <div>
      <ol>{data.map((array) => ListItem(array))}</ol>
    </div>
  );
};

export default Holidays;

score:1

const Holidays = ({ data }) => {
  // console.log(data);
  return (
    <div>
      <ol className="App">
        {data.map((item, i) => {
          // since you are passing Object.entries, the first parameter is the key
          // and the second one are the values
          const [key, obj] = item;

          // you then just have to map the event inside the values
          return obj.events.map((o, index) => (
            <li key={index}>
              <div>title: {o.title}</div>
              <div>Date : {(o.date)}</div>
            </li>
          ));
        })}
      </ol>
    </div>
  );
};

Related Query

More Query from same tag