React Pure Functions?

RMAG news

Hello devs,

Writing here to ask more devs about some suggestions going on within my team.
Currently we have a dev within our team implementing Jest.
It’s brought up a good discussion on how our repo is set up, and how we’re building components.
The dev in question is saying that it’s not easy or practical to test with jest because our functions aren’t pure.
I’d like to get some more knowledge on this, I do know in the docs it references pure components. But does this mean that if I have an api call that sets states conditionally would that make our code not up to standard?
Docs and reading appreciated!

Thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *