Closed mayank99 closed 1 year ago
It would be nice to have tests for these scenarios to make sure we don't break it in the future.
This is all typescript stuff and there is no change in runtime, so I'm not really sure how to test it tbh.
This is all typescript stuff and there is no change in runtime, so I'm not really sure how to test it tbh.
Add examples with different usage might be a start [Another PR problems]
Instead of relying on
UseThemeProps
,ThemeProvider
now defines its own props and uses conditional typing to excludeownerDocument
fromthemeOptions
if children is passed, and keepownerDocument
if children not passed (for backwards compatibility). This change is intended to prevent accidentally passingownerDocument
. Would be nice to release it as a patch of 2.0 rather than in 2.1 so that users have a smaller window to make this mistake.Also, since we are defining a new type, I used the opportunity to write a better jsdoc for the
theme
prop, warning about SSR behavior.