Directly modifying state – Do not mutate state directly. Use setState()
Understanding State Immutability in React Why You Shouldn’t Mutate State Directly In React, you should never modify state directly because: Bad Practice: Direct Mutation Good Practice: Using setState() For Functional….