KockaAdmiralac / uty-save-editor

Save editor for Undertale Yellow.
https://uty-save-editor.netlify.app
MIT License
5 stars 1 forks source link

Pass save file data through props instead of context #8

Open KockaAdmiralac opened 8 months ago

KockaAdmiralac commented 8 months ago

Right now, all saves are under the same context and controls that modify save file data (all of them) use the same context. This means that all the controls re-render whenever any control changes save file data. This does not currently create performance issues (aside from ones with the Steamworks ID editor... which were patched rather horribly) because the editor is not very big, but could create them in the future.

The solution to this is to have save files as state in the app, passed to their respective editors and controls through props. This way, only controls whose values were actually changed get re-rendered.