Release v1.0.2 - Bug Fix 🔧
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().