2017-08-23 71 views
0

我用这个启动包https://github.com/wellyshen/react-cool-starter无法删除组件(阵营JS)

有插入的零部件的UserList首页容器

当我尝试只是评论这个领域拥有自营。 import UserList from '../../components/UserList';我有错误,我需要删除此组件

[webpack-isomorphic-tools] [error] asset not found: ./src/components/UserList/styles.scss 
==> Rendering routes error: TypeError: Cannot read property '_style' of undefined 

我只是删除导入,为什么会发生?

的UserList部件

import React from 'react'; 
import { Link } from 'react-router-dom'; 

import styles from './styles.scss'; 

type Props = { list: Array<Object> }; 

const UserList = ({ list }: Props) => (
    <div className={styles.UserList}> 
    <h4>User List</h4> 
    <ul> 
     {list.map(user => (
     <li key={user.id}> 
      <Link to={`/UserInfo/${user.id}`}>{user.name}1111</Link> 
     </li> 
    ))} 
    </ul> 
    </div> 
); 

UserList.defaultProps = { 
    list: { 
    id: '', 
    name: '', 
    }, 
}; 

export default UserList; 

SCSS USERLIST

@import” ../../theme/variables';

.UserList { 
    color: $color-white; 

    ul { 
    padding-left: 17px; 

    li { 
     margin-bottom: 0.5em; 
    } 
    } 

    a { 
    color: $color-white; 
    } 
} 
+0

我们可以看到'SRC /组件/ UserList的/ styles.scs'和你UserList的成分吗? –

+0

已更新,请检查 –

+0

但是您已经找到解决方案,对不对? –

回答

0

问题是utils的/ html.js

有requere require('../components/UserList/styles.scss')._style +