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;
}
}
我們可以看到'SRC /組件/ UserList的/ styles.scs'和你UserList的成分嗎? –
已更新,請檢查 –
但是您已經找到解決方案,對不對? –