Skip to content

Conversation

@EwanRoycroft
Copy link
Member

@EwanRoycroft EwanRoycroft commented May 31, 2022

Description

Adds the maintainActiveChildren option to insertTree(). If enabled, any active children specified in the subTreeRootNodeConfig will be assigned once the tree is registered.

Motivation and Context

I have a use-case where I want to cache a tree and then restore it at a later date. When I do so, I need the tree to maintain any previously-activated children so the page layout is maintained. I do not want to trigger an activeChild event, I need the children to be silently re-activated as the tree is re-registered.

How Has This Been Tested?

I have an example of this code running in the demo for bbc/react-lrud-cache-route. All existing jest tests pass.

I have defaulted the maintainActiveChildren to false so it will not affect any current users of this library.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

If the maintainActiveChildren option is set, any activeChildren set in
the subTreeRootNodeConfig will be assigned.
@EwanRoycroft EwanRoycroft marked this pull request as ready for review May 31, 2022 15:50
@EwanRoycroft EwanRoycroft requested a review from a team as a code owner May 31, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant