Closed filipizydorczyk closed 2 years ago
I had the same problem. My solution was to downgrade @types/react and @types/react-dom to
"@types/react": "17.0.47",
"@types/react-dom": "17.0.17",
Unfortunately React 18 introduced a breaking change in TS where children
is no longer available on FC
. Will fix this now.
Hello! I just started to use this library and immediately run into types issue. When i put this code
And I try to use
Media
andMediaContextProvider
as react elements in my functional componentI get this error messages
and same error for provider
I have no idea why its happening but I did manage to cheat typescript. I just wrote these asserions
Then errors disapeared and I was able to run code and everything was working as expected. I belive there is a problem in types but maybe I am missing something?
tsconfig.json