'How do i handle a large array in a react app?

I am currently developing a webinterface for a camera system. I use the react framework and websockets for communication with the camera. I have to render an image to a canvas in serveral places in the app. The image data comes as an array containing brightness values for every pixel. Resolution is 800x600 so 480k array entries. I would like to store the last recieved image so I don't have to request a new one each time i render a canvas. I tried storing the array in the state of the App component but the ui got slowed down a lot. Any recommendations on how to store that data and access it from different places?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source