Add lib
parent
6ba79c454d
commit
2874be65d9
@ -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…
Reference in New Issue