Replies: 5 comments 1 reply
-
|
Probably an asynchronous issue. |
Beta Was this translation helpful? Give feedback.
-
|
I see you are using react. |
Beta Was this translation helpful? Give feedback.
-
|
@alwalxed instead of directly using state management, i stored a ref to handle JSON which Worked fine for me (i was implementing Undo/Redo functionality which is somewhat similar to what you are trying to do). As @asturur mentioned, we need to avoid Canvas being re-rendered while we are using |
Beta Was this translation helpful? Give feedback.
-
|
restore canvas state: TypeError: Cannot read properties of undefined (reading 'clearRect') |
Beta Was this translation helpful? Give feedback.
-
|
React strict mode in development runs useEffect twice. useEffect(() => { this logs. mount -> unmount -> mount (back again). Verify with this. in nextjs turning it off. Resolves the issue for me. import type { NextConfig } from "next"; const nextConfig: NextConfig = { export default nextConfig; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm developing a stateful canvas with two listeners that track changes and save them to localStorage. Upon loading, it checks for and restores any stored data.
The canvas loads, but I’m encountering an unresolved error, and objects are positioned at the top.
Error
Listener
Helper
Additionals
Beta Was this translation helpful? Give feedback.
All reactions