Skip to content

Action.Push need onPop props to trigger some state change #896

Closed

Description

@chyroc

current, Action.Push props:

image

i need onPop props to trigger outter components some action done, and some state chagne.

Activity

  1. added
    api
    feature request
    on Feb 14, 2022
  2. thomaspaulmann commented on Feb 23, 2022

    @thomaspaulmann
    Member

    Not sure if the push action is the right place to add such functionality. Maybe it should be rather something of the useNavigation hook. The hook could provide some callback that is triggered as soon as the the component is rendered again.

    Not exactly sure about your use case, but you could add some callback to the component that you push. The callback can then update the previous screen. As far as I understand, this should solve your problem.

  3. thomaspaulmann commented on Apr 20, 2022

    @thomaspaulmann
    Member

    I'm closing this issue given that there is a workaround for it.

  4. MarlBurroW commented on Oct 12, 2023

    @MarlBurroW
    Contributor

    This workaround doesn't work.
    I've a Websocket on the main command screen updating a state passed on a pushed screen (data are stored with a useState hook).
    The state is passed to the second screen via a prop.

    Example

    <Action.Push title="Monitor detail"   monitor={monitor}/>} />

    When the websocket update data on the main screen, this update doesn't trigger re-rendering on the pushed screen.

  5. added a commit that references this issue on Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apifeature request

    Type

    No type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions