is necessary ?
App.jsx:
import React from "react";
import Greetings from "./Greetings";
import { PageHeader } from "react-bootstrap";
// this line apparentlly bundles fullstack.css into dist/styles.css
require('../css/fullstack.css');
export default class App extends React.Component {
render(){
return (
<PageHeader>
<div className="header-contents">
<p>App.jsx</p>
<Greetings name="World" />
</div>
</PageHeader>
);
}
}
Context: using css-loader, style-loader, extract-text-webpack-plugin etc
Had I not dug through the repo's commit history, I'd have no idea I'd need it:
https://github.com/angineering/FullStackTemplate/commit/6181f5ec12284e4c828743a0ee074a1fa3175ff8
require just executes the code in the module
It's not necessary and I would recommend against it.
Обсуждают сегодня