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

Remove dependency on `create-react-context`

Open isc30 opened this issue 3 years ago • 2 comments
trafficstars

Hey, really useful library!

I noticed it uses create-react-context as a dependency, and create-react-context only supports up to react: ^16.0.0. Do you think it's possible to remove that dependency and use the normal 'createContext` from React?

isc30 avatar Oct 10 '22 14:10 isc30

is there any problem right now?

create-react-context is used between versions 16.0.0 and 16.3.0 to support React.createContext which is only supported on 16.3.0, it works as follows

  • between versions 16.0.0 and 16.3.0: use implementation methods of itself
  • ^16.3.0: use React.createContext directilly

image

CJY0208 avatar Oct 11 '22 01:10 CJY0208

yeah, as it's marked a direct dependency instead of optional dependency, PNPM warns when using React18 as it's not supported by create-react-context.

I think making it an optional dependency could solve it

El mar., 11 oct. 2022 3:50, CJY @.***> escribió:

is there any problem right now?

create-react-context is used between versions 16.0.0 and 16.3.0 to support React.createContext which is only supported on 16.3.0, it works as follows

  • between versions 16.0.0 and 16.3.0: use implementation methods of itself
  • ^16.3.0: use React.createContext directilly

[image: image] https://user-images.githubusercontent.com/18415774/194979137-3c436313-5e09-4fbd-b19b-befd2dcd5a23.png

— Reply to this email directly, view it on GitHub https://github.com/CJY0208/react-activation/issues/230#issuecomment-1273984080, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSOOCZOUMSMUSYHKJQHUP3WCTBVNANCNFSM6AAAAAARBND4HI . You are receiving this because you authored the thread.Message ID: @.***>

isc30 avatar Oct 11 '22 11:10 isc30