Skip to content

function to overwrite global options don't update after dependency change #359

Open
@joaoarieira

Description

@joaoarieira

Describe the bug
I'm using a API that needs to send a dynamic value on header. But when this value changes, the function that overwrite the global options use the old value.

⚠️ Make a Codesandbox ⚠️
https://codesandbox.io/s/usefetch-use-http-todo-list-app-managed-state-forked-b6i4w?file=/src/index.js

To Reproduce
Steps to reproduce the behavior:

  1. Click on "Change dependency"
  2. See "dependency: 0" changing next to the button
  3. See console.log where the value don't change

Expected behavior
The overwite global options function must use updated values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions