When not to use useCallback method in React

The useCallback hook is a powerful tool that can be used to improve the performance of React components. It is especially useful for components that use callbacks that are expensive to evaluate.

Continue reading “When not to use¬†useCallback method in React”

Points to remember before writing Test Cases

Single Responsibility Principle (SRP)

  1. Clear and focused tests

By following SRP, each unit test focuses on testing only one specific behavior or functionality of the code. This makes the test case clearer and easier to understand.

  1. Easier maintenance

When tests have a single responsibility, any changes or updates to the code under test will likely require only one corresponding update to the test case. This simplifies maintenance and reduces the risk of introducing errors.

Continue reading “Points to remember before writing Test Cases”