dev
Alfred Melch 5 years ago
parent 6ba79c454d
commit 2874be65d9

@ -1,6 +1,7 @@
import React from 'react'
import './App.css'
import { Canvas } from './components.js/Canvas'
export const App = () => {
return (
@ -9,7 +10,7 @@ export const App = () => {
<h1>Ebermergen</h1>
</header>
<main>
<canvas></canvas>
<Canvas />
</main>
<footer>Made by Alfred Melch</footer>
</>

@ -0,0 +1,12 @@
import React, { useLayoutEffect, useRef } from 'react'
import { main } from '../lib'
export const Canvas = () => {
const canvasRef = useRef(null)
useLayoutEffect(() => {
main(canvasRef.current)
})
return <canvas width={500} height={400} ref={canvasRef} />
}

@ -0,0 +1,6 @@
console.log('import entrypoint lib')
export function main(canvas) {
console.log('entrypoint function')
console.log(canvas)
}
Loading…
Cancel
Save