2017-08-23 73 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 +