Skip to content

Release v1.0.2 - Bug Fix 🔧

Choose a tag to compare

@smartlabsAT smartlabsAT released this 10 Feb 21:24
· 27 commits to main since this release

In this release, we’ve fixed an issue where passing an Axios instance into the AxiosProvider would inadvertently cause the instance to be executed. This happened because React’s useState treats a function passed directly as an initializer as a lazy initializer, thus calling it immediately.

What’s fixed:
• The Axios instance is now wrapped in a lambda (() => instance) when setting the initial state. This ensures that the instance is stored as-is without being inadvertently invoked.
• This change prevents unexpected behavior and ensures that your Axios instance remains intact until you decide to update it via updateAxios().