components directory
This commit is contained in:
parent
0a8d671e80
commit
77710c345a
15
src/components/app/index.tsx
Normal file
15
src/components/app/index.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import MushroomCatImage from './mushroom-cat.png';
|
||||
|
||||
import Portrait from '../portrait';
|
||||
import { FC } from 'react';
|
||||
|
||||
const App: FC = () => {
|
||||
return (
|
||||
<div>
|
||||
<div>Hello, Webpack</div>
|
||||
<Portrait src={MushroomCatImage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
@ -1,25 +1,8 @@
|
||||
import { FC } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { doWork } from './module';
|
||||
import App from './components/app';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
import MushroomCatImage from './img/mushroom-cat.png';
|
||||
|
||||
import Portrait from './portrait';
|
||||
|
||||
const App: FC = () => {
|
||||
const num = doWork();
|
||||
console.log('work gave', num);
|
||||
return (
|
||||
<div>
|
||||
<div>Hello, Webpack</div>
|
||||
<Portrait src={MushroomCatImage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const main = document.querySelector('main');
|
||||
if (main === null) {
|
||||
throw new Error('unable to find main!');
|
||||
|
@ -1,4 +0,0 @@
|
||||
export function doWork(): number {
|
||||
console.log('doing some major work right now B)');
|
||||
return 4;
|
||||
}
|
Loading…
Reference in New Issue
Block a user