gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

"Warning: Legacy context API has been detected within a strict-mode tree."

Open miikakuisma opened this issue 5 years ago • 3 comments

bug report

I'm getting this in the console.

Screenshot 2020-06-25 at 19 32 15

library version

  • gl-react version 4.0.1
  • React version 16.12.0

miikakuisma avatar Jun 25 '20 16:06 miikakuisma

I guess we will have to switch to use React context, it's a bit a shame because the legacy API was quite convenient but here it will require gl-react to have 2 nested vdom (as a Node is both a context consumer and a context provider).

gre avatar Dec 23 '20 20:12 gre

I'm afraid migrating to latest context API is really not an easy task for gl-react. I hope it's not planned to be dropped yet..

nesting <Consumer> & <Provider> to inject the glParent/glSurface/glSizable is going to be super overkill, and even if we manage to get it working, i'm not sure how I can solve the fact gl-react deeply work with classes today and expect to use references of these to build up a "dependency graph" where we can then hook things to redraw bottom-to-top.

(was discussing it on https://twitter.com/greweb/status/1342776401011871745 too)

gre avatar Dec 26 '20 17:12 gre

Hey @gre is there any path forward for this? disabling strict mode seems like the only solution so far, but at some point in time, gl-react will need to support the new context apis.

Digized avatar Jul 03 '23 19:07 Digized