Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Side effects inside ProgressTabs and related components #4162

Open
3 tasks
odomyshev opened this issue Nov 18, 2024 · 3 comments
Open
3 tasks

Side effects inside ProgressTabs and related components #4162

odomyshev opened this issue Nov 18, 2024 · 3 comments
Labels
Area: Components Related to the component library (core) of this system Fix/Change in Progress DSYS is currently working on a solution and will update the thread with results Type: Bug Something isn't working

Comments

@odomyshev
Copy link

Description

When I have any side effects in the parent components, any contents of ProgressTabs gets forcefully unrendered and rerendered back.
Because of that it's impossible to have any side effects inside contentful progress steps

Link to Reproduction

console.twilio.com

Steps to reproduce

I synced with @krisantrobus (I think the issue is not easy to reproduce outside of Console)

Paste Core Version

20.16.0

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@odomyshev odomyshev changed the title Side effects inside ProgressTabs and related component Side effects inside ProgressTabs and related components Nov 18, 2024
@dosubot dosubot bot added Area: Components Related to the component library (core) of this system Type: Bug Something isn't working labels Nov 18, 2024
@krisantrobus
Copy link
Collaborator

For internal team reference I have validated the issue. We spent over an hour debugging together. The cause here is from the emotion library. For progress steps we use the styled.div constructor and this is getting rerendered whenever there is a side effect. Very strage but also found a lot of refernces with rerender issue for this library.

@krisantrobus krisantrobus added the Fix/Change in Progress DSYS is currently working on a solution and will update the thread with results label Nov 21, 2024
@krisantrobus
Copy link
Collaborator

Hi @odomyshev I have a fix for this up in this PR. This will be included in our next release but this won't be for another 3-4 weeks and will take time for the web platform team to upgrade. If you need this sooner my recommendation would be to swap the root ProgresSteps component with this file in your code and swap back in with our PAste component after the release.

The issue was with a third party library. We found that when we pass in props from the parent component. into the CSS generation logic it would always re-render with side effects even though the props are unchanged. We fixed by using useMemo. I have tested this in your branch and is working as expected.

One other note, when our team were reviewing the working branch to debug we had some feedback for you designer. We do not recommend using multiple progress steppers (one in the top bar and a vertical in the page). We had a previous discussion around this and a recording for our office hours can be found here. Let them know they can start a discussion with us through GitHub or block some time with us during an office hours.

@krisantrobus
Copy link
Collaborator

Hi @odomyshev, this fix has now ben merged and will go out with our next release. Thank you for raising this with us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Components Related to the component library (core) of this system Fix/Change in Progress DSYS is currently working on a solution and will update the thread with results Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants