Application is built on Node/React/Express.
I have a table component and then a sub component for each row in the table that is generated dynamically from an array (clients
) which is collected from the db by a react context api call and stored in state. I then map over the array and create a row (Client
component) for each client.
<TableBody>
{clients.map(client => (
<Client
key={client.id}
client={client}
handleSnackBar={this.props.handleSnackBar}
handleSendMail={this.props.handleSendMail}
/>
))}
</TableBody>
On each of these rows is a button that can activate or deactivate the client's account.... now that the array (client list) is up to 1000 records, it's taking a solid 3 seconds to activate or deactivate the account and reflect the changes.
I'm looking for a) any issues with doing it how I'm doing it, b) suggestions for speeding up this process and optimizing the code, c) is Redux a better option for this? Or, I guess, d) do I have unrealistic expectations and I should just add a loading spinner and call it good?