Closed tyleryy closed 7 months ago
Click on “List item” → type on item description or item name The text is laggy and slow when rendering
In CreateModal, we use onChange to update item name + item description. This make it so that every time user types, it do a rerender → cause the program to be slow
Replace onChange with useRef (https://react.dev/reference/react/useRef)
In the list item modal, when the user types a description of the item, it is slow and the typing lags. This may because the onChange callback for the Chakra textbox is called for every key input in the textbox, overloading the component's re-rendering.
May need to make component uncontrolled and use a ref to get the text state in only when needed (when the next button is pressed)