GaryCJ
KPCKevin Powell - Community
•Created by GaryCJ on 1/26/2024 in #front-end
React - Updating useState as a Multidimensional array.
Hi, I am looking at the performance consequences of managing a state via a Multidimensional array.
Currently, I am representing a 15x15 grid as a multidimensional array, each cell (gridName[row][col]) contains five "key:value" pair pieces of data about that particular cell. When a user clicks a cell, it calls the useState function to update the contents of the key:value pair for that cell, and depending on the update, it may also update another cell; this updates are then used to change the visual data within the cell. This is done by returning a new version of the array. This is my first react project, so I am wondering what the performance impact of this may be, as I can't seem to find a better way to do it, and in the dev console, each update is around 4ms. Also note, that the grid size will always be 15x15, so larger grids aren't an issue.
5 replies
KPCKevin Powell - Community
•Created by GaryCJ on 6/30/2023 in #back-end
Symfony - Twig template rendering
Can you render a set of twig template files locally without having to use a route controller to do so?
My experience with Symfony is limited, and I have been slowly chipping away at it, I'm at a point I can comfortably write templates and controllers on my own projects and have played around with doctrine. However, a company I work for has its website managed through a proprietary CMS built on the framework, which only runs if you have the correct image installed locally. They don't have controllers that I am familiar with and only work via the platform / locally installed platform.
I'd like to be able to view the templates so I can see what is going on.
Thank you.
1 replies