polaris icon indicating copy to clipboard operation
polaris copied to clipboard

ColorPicker throws error when rendered inside function component

Open vfonic opened this issue 2 years ago • 1 comments

Issue summary

I'm using Shopify Polaris with React 17 (17.0.2). I noticed that every time that I render ColorPicker, I get the following error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

ColorPicker

Expected behavior

No error should be raised.

Actual behavior

Steps to reproduce the problem

  1. Create new React app with latest stable React release
  2. Render ColorPicker component

Reduced test case

The best way to get your bug fixed is to provide a reduced test case. This CodeSandbox template is a great starting point.

It would be great if the CodeSandbox template was upgraded to the latest version of Shopify Polaris. I tried, but failed to get it updated.

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: 6.6.0
  • Browser: /
  • Device: /
  • Operating System: /

Or run npx envinfo --system --binaries --browsers --npmPackages react,react-dom,@shopify/polaris to provide specifications on your environment including version numbers, browser, device, and operating system.

Paste the results here:


vfonic avatar Sep 08 '21 07:09 vfonic

I'm experiencing the same error, but intermittently. Hard to reproduce on-demand. I see it maybe 3x a day, most recently in the PositionedOverlay component.

benhickson avatar Jun 23 '22 16:06 benhickson

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's design system and dev experience.

github-actions[bot] avatar Apr 16 '23 03:04 github-actions[bot]