polaris
polaris copied to clipboard
ColorPicker throws error when rendered inside function component
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.
Expected behavior
No error should be raised.
Actual behavior
Steps to reproduce the problem
- Create new React app with latest stable React release
- 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:
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.
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.