Skip to content

Propagation state Effects section #79

Open
@piloandres

Description

@piloandres

Hello,
I have a little confusion with what is explained in the Effect section about the propagation of data.

Brian says that propagation happens when setBreed("") is called. I understand that, but I decided to comment that line and just call setBreeds([]) instead. Surprisedly, the propagation happened, that means that the BreedDropdown re-rendered.

This is how I let useEffect
Screen Shot 2020-02-18 at 10 31 32 PM

This is my main doubt.

Why the BreedDropDown updates? If I updated Breeds only. The main relation I can see between Breeds and BreedDropdown is the statement const [breed, BreedDropdown, setBreed] = useDropdown("Breed", "", breeds);. If some input of the hook is updated, this is re-rendered? or it is just a misunderstanding?

Thank you for reading my issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions