contentful / forma-36

A design system by Contentful
https://f36.contentful.com
MIT License
335 stars 81 forks source link

🐛 Bug - Legacy context API detection warning in Button component with React 17 #997

Closed cachrisman closed 3 years ago

cachrisman commented 3 years ago

Forma 36 bug report

Summary

I'm creating a little chrome extension using react 17.0.1 and also using Forma36 for the UI elements and I see an error in DevTools which says

Warning: Legacy context API has been detected within a strict-mode tree. 
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. 
Please update the following components: Transition 
Learn more about this warning here: https://reactjs.org/link/legacy-context

image

from the stacktrace it seems it is happening in the Button component from something called CSSTransition provided by the react-transition-group package. The version of that package that gets installed from the latest version of @contentful/forma-36-react-components is 2.9.0 but the most up-to-date released version is 4.4.2. Perhaps upgrading the react-transition-group dependency would fix this warning?

Environment

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36

Steps to reproduce

Use the Button component in a React v17 application

Expected results

no warnings

Actual results

the warning in the summary above

denkristoffer commented 3 years ago

@all-contributors please add @cachrisman for bug

allcontributors[bot] commented 3 years ago

@denkristoffer

I've put up a pull request to add @cachrisman! :tada: