Skip to content

Updating state in child components #42

@AlexeyRaga

Description

@AlexeyRaga

Hi,

I am using the following lens-based approach to propagate a part of the state to the downstream components:

fold
   [ T.focus _items _ListItemAction $ T.foreach \_ -> listItemSpec
   , listActions
   ]

The first component renders a list of items, the second doesn't render anything but defines performAction.

When listItemSpec is updating the state the change is correctly propagated to the parent component through the lens, but the performAction in the second component (listActions) always receives the "old" state, the one "before" changes are applied through the _items lense.

How can a parent component update the state after it has been altered by its children?

Thanks.

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