Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Refactor expansion #559

Merged
merged 2 commits into from
Mar 22, 2022
Merged

Refactor expansion #559

merged 2 commits into from
Mar 22, 2022

Conversation

oliverlloyd
Copy link
Contributor

What does this change?

This PR simplifies how expansion is handled.

It removes the callback we were using to track how long it took to expand as this were adding complexity to the code and was no longer needed or used. We previously used this callback as part of the migration to Emotion 11 work.

It adds a step to ensure that the isExpanded state is set whenever the expanded prop changes. There are use cases where the Discussion component in the parent is reloaded with a new value for this prop (permalinks) and we need to respect this.

This PR closes guardian/dotcom-rendering#4297

@github-actions
Copy link
Contributor

Size Change: -40 B (0%)

Total Size: 218 kB

Filename Size Change
build/App.esm.js 109 kB -22 B (0%)
build/App.js 109 kB -18 B (0%)

compressed-size-action

Copy link
Contributor

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@oliverlloyd oliverlloyd merged commit db42ce3 into main Mar 22, 2022
@oliverlloyd oliverlloyd deleted the oliver/permalinks branch March 22, 2022 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment permalinks not working
2 participants