callstack / react-theme-provider

A set of utilities that help you create your own React theming system in few easy steps
MIT License
466 stars 54 forks source link

Fix ThemeProvider types in React 18 #142

Closed krystofrezac closed 7 months ago

krystofrezac commented 2 years ago

I added children to the ThemeProvider props type. In React 18 implicit children type was removed and needs to be typed explicitly. tweet with more info issue

SergeyBakutov commented 1 year ago

@krystofrezac, you can add React.PropsWithChildren ThemeProvider: React.ComponentType<React.PropsWithChildren<{ theme?: Theme }>>; . Both options are correct

krystofrezac commented 1 year ago

@SergeyBakutov good point. I think that your suggestion is cleaner so I updated the code😃

sorenhoyer commented 1 year ago

👀

s1gr1d commented 1 year ago

Any updates on this? I'm also having this type issue with React 18

BohdanK-W32 commented 1 year ago

So?

douglasjunior commented 11 months ago

Fixed in #155 and released on version 3.0.9