Hello Robin and thanks for your response.

From what I see in it, you are writing too large react components, and perhaps too large functions over all. In a smaller scope it is clear what "description" is, because the component you're looking at is only for rendering an order event.

Another thing (that you could consider to be premature optimization, sure, but still) is that if you do props.order.x.y.z lots of times in your scope, JS needs to dig out the variables the whole way each time.

You have much more performance to gain from dividing big React components in smaller ones, so that as little as possible needs to re-render on props/state changes.

It is also not as DRY.

Esbjörn Blomquist
Esbjörn Blomquist

Written by Esbjörn Blomquist

Software architect and developer with web and functional JavaScript close to his heart. Worked many years with web solutions mainly within the IoT field.

No responses yet