mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 21:58:31 +00:00
fix dependency array
This commit is contained in:
parent
9afddf0850
commit
88684d6d9e
@ -12,8 +12,8 @@ function useStrudel({
|
||||
initialCode = '',
|
||||
autolink = false,
|
||||
beforeEval,
|
||||
editPattern,
|
||||
afterEval,
|
||||
editPattern,
|
||||
onEvalError,
|
||||
onToggle,
|
||||
canvasId,
|
||||
@ -105,11 +105,11 @@ function useStrudel({
|
||||
|
||||
const inited = useRef();
|
||||
useEffect(() => {
|
||||
if (!inited.current && drawContext && onDraw && evalOnMount && code) {
|
||||
if (!inited.current && evalOnMount && code) {
|
||||
inited.current = true;
|
||||
evaluate(code, false).then((pat) => drawFirstFrame(pat));
|
||||
}
|
||||
}, [activateCode, evalOnMount, code, drawFirstFrame]);
|
||||
}, [evalOnMount, code, evaluate, drawFirstFrame]);
|
||||
|
||||
// this will stop the scheduler when hot reloading in development
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user