错误类型landig.Slots在React JS中未定义

时间:2019-01-21 16:52:55

标签: json reactjs parsing product

  

错误区域的类型。插槽未定义

import Link from "next/link";
import { connect } from "react-redux";

import Slot from "../components/slot";
import LandingLoader from "./landing-loader";
import ListingsContainer from "crust/containers/listings";

class Landing extends React.Component {
  state = {
    flexHeight: "auto"
  };

  setHeight(height) {
    if (this.default) {
      this.default.style = `height:${height}px; overflow:hidden`;
    }
  }

  render() {
    let { error, land

ing,slotsLoaded,slotsToLoad,showListings} = this.props;     准备就绪=登陆&& slotLoaded;     返回(        (this.default = ref)}         样式= {           showListings             ? {                 高度:“自动”,                 溢出:“自动”,                 overflowX:“隐藏”               }             :{}         }>                                                                                    {着陆&&               landing.Slots.map((slot,index)=> {                 if(slot &&!slot.removed){                   让fullWidth =“ 100%”;                   让maxWidth = 576;

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

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

} }

导出默认的connect(state => state)(Landing);

0 个答案:

没有答案