fix dependency array
This commit is contained in:
parent
9afddf0850
commit
88684d6d9e
1 changed files with 3 additions and 3 deletions
|
|
@ -12,8 +12,8 @@ function useStrudel({
|
||||||
initialCode = '',
|
initialCode = '',
|
||||||
autolink = false,
|
autolink = false,
|
||||||
beforeEval,
|
beforeEval,
|
||||||
editPattern,
|
|
||||||
afterEval,
|
afterEval,
|
||||||
|
editPattern,
|
||||||
onEvalError,
|
onEvalError,
|
||||||
onToggle,
|
onToggle,
|
||||||
canvasId,
|
canvasId,
|
||||||
|
|
@ -105,11 +105,11 @@ function useStrudel({
|
||||||
|
|
||||||
const inited = useRef();
|
const inited = useRef();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!inited.current && drawContext && onDraw && evalOnMount && code) {
|
if (!inited.current && evalOnMount && code) {
|
||||||
inited.current = true;
|
inited.current = true;
|
||||||
evaluate(code, false).then((pat) => drawFirstFrame(pat));
|
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
|
// this will stop the scheduler when hot reloading in development
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue