react-with-direction icon indicating copy to clipboard operation
react-with-direction copied to clipboard

Legacy context usage prints warnings in React StrictMode

Open petevk opened this issue 4 years ago • 3 comments

I noticed when using rheostat that this project is printing warnings in React StrictMode because it's using the legacy React Context instead of the one released in React 16.3. I understand this library would like to continue supporting React <16.3, but it also prevents using concurrent mode when that is eventually released into stable.

What is the long term strategy for releasing this library? Should there be a new major version/forked library which supports React 16.3+? Is it possible to feature-detect the new Context API and use that if it's available?

petevk avatar May 05 '20 18:05 petevk

If it's possible, a PR would be very welcome - otherwise it would require a breaking change.

ljharb avatar May 05 '20 18:05 ljharb

It seems like such a thing is possible with this library -- https://github.com/jamiebuilds/create-react-context (or the smaller https://github.com/StringEpsilon/mini-create-react-context). I found it because some other libraries like react-router use it to support both React 15 and 16+.

petevk avatar May 18 '20 17:05 petevk

I'm facing the similar issue while using it, it may due to "withDirectionPropTypes", it should fix with Context API image

Hamzaalam avatar Jul 07 '20 09:07 Hamzaalam