简体   繁体   English

反应组件未显示

[英]React component not showing

I'm trying out the examples in a book called Fullstack React . 我正在尝试一本名为Fullstack React的书中的示例。 I don't know why the Product component isn't showing. 我不知道为什么Product组件没有显示。 I'm also a newbie to React and StackOverflow . 我还是ReactStackOverflow的新手。 Sorry for the mistakes I might make. 对不起,我可能会犯的错误。

class Product extends React.component {
  render() {
    return (
      <div className='item'>
        <div className='image'>
          <img src='images/products/image-aqua.png' />
        </div>
        <div className='middle aligned content'>
        <div className='description'>
          <a> Fort Knight </a>
          <p> Authentic renaissance actors, delivered in  just two weeks.</p>
        </div>
        <div className='extra'>
          <span> Submitted by:</span>
          <img 
            className='ui avatar image'
            src='images/avatars/daniel.png'
          />
        </div>
      </div>
    </div>
      );
  }
}

class ProductList extends React.Component {
  render() {
    return (
      <div className='ui unstackable items'>
        <Product />
      </div>
    );
  }
}

And it also uses the semantic framework. 并且它也使用语义框架。

React.component should be React.Component React.component应该是React.Component

You can also import Component at the same time as main React, eg 您也可以与主React同时导入Component,例如

import React, { Component } from 'react'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM