Using antd+typescript, you want to customize the contents of the List component, but prompt that you need to add the necessary properties

1. When you refer to the antd-pro noticeIcon component, you find that the List component is used in antd-pro and does not provide the necessary properties.

      <List className={styles.list} >
        {data.map((item, i) => {
          const itemCls = classNames(styles.item, {
            [styles.read]: item.read,
          });
          return (
            <List.Item className={itemCls} key={item.key || i} onClick={() => onClick(item)}>
              <List.Item.Meta
                className={styles.meta}
                avatar={item.avatar ? <Avatar className={styles.avatar} src={item.avatar} /> : null}
                title={
                  <div className={styles.title}>
                    {item.title}
                    <div className={styles.extra}>{item.extra}</div>
                  </div>
                }
                description={
                  <div>
                    <div className={styles.description} title={item.description}>
                      {item.description}
                    </div>
                    <div className={styles.datetime}>{item.datetime}</div>
                  </div>
                }
              />
            </List.Item>
          );
        })}
      </List>

in this code, List does not provide dataSource and so on and uses the onClick attribute in List.Item, but it is not available in List.Item "s props.

2. Now that I use typescript to write this code, I will find a lot of errors

.
1 at the List prompt I need to provide the necessary properties
2 prompt me at Item that onClick is not in the props

clipboard.png

3, so how should I solve this problem

Mar.29,2021

https://github.com/ant-design.

<List className={styles.list} dataSource={[]} renderItem={this.renderItem}>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4609d-43ed8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4609d-43ed8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?