React Performance: JS Perf — toSorted Immutable. Keywords: tosorted sort immutable. Platform: React/Next.js. Description: Use toSorted() instead of sort() to avoid mutating arrays. Do: Use toSorted() for immutability. Don't: Mutate arrays with sort(). Good Example: users.toSorted((a,b) => a.name.localeCompare(b.name)). Bad Example: users.sort((a,b) => a.name.localeCompare(b.name)) // mutates. Severity: Medium-High.