components directory

This commit is contained in:
Michael Peters 2023-01-09 17:40:21 -08:00
parent 0a8d671e80
commit 77710c345a
5 changed files with 16 additions and 22 deletions

View 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;

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -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!');

View File

@ -1,4 +0,0 @@
export function doWork(): number {
console.log('doing some major work right now B)');
return 4;
}