how to solve undefined error in react js when fetching data from API?

how to solve undefined error in react js when fetching data from API?

<br>

Am getting an error like TypeError landing. Slots are undefined
<div className="notification" />
        </header>
        <main
          style={
            ready
              ? {}
              : {
                  height: "100vh",
                  overflow: "hidden"
                }
          }>
          <LandingLoader className={ready ? "fade-out" : ""} />
          <ul
            className="slots"
            style={{
              visibility: ready ? "visible" : "hidden"
            }}>
            {landing &&
              landing.Slots.map((slot,index) => {
                if (slot && !slot.removed) {
                  let fullWidth = "100%";
                  let maxWidth = 576;

              let style = {};
              style["width"] = fullWidth;
              style["maxWidth"] = fullWidth;
              style["height"] = slot.HeightPixel + "px";

              return (
                &lt;li key={index} className="slots" style={style}&gt;
                  &lt;Slot slotItem={slot} slotIndex={index} /&gt;
                &lt;/li&gt;
              );
            }
          })}
      &lt;/ul&gt;
    &lt;/main&gt;
  &lt;/div&gt;


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Create web api project

LIKE | COMMENT | SHARE | SUBSCRIBE Web API with MVC Project Visual Studio (2013/2015/2017/2019) includes Web API template which creates a new Web API project...

Create Api controller and action

LIKE | COMMENT | SHARE | SUBSCRIBE Web API Controller We created Web API with MVC project in the previous section where it generated a simple controller. Her...

Remove the XML Formatter from ASP.NET Web API

LIKE | COMMENT | SHARE | SUBSCRIBE ASP.NET Web API's default output format is supposed to be JSON, but when I access my Web APIs using the browser address ba...