Releases: birdofpreyru/react-themes
Releases · birdofpreyru/react-themes
v1.7.0
Breaking Changes
- [#63] As
propTypes
checks are deprecated in React v19, the following related changes have been done in this library:-
Removed optional
themeSchema
argument of themed() function. -
Removed
castTheme
property, andthemeType
field of themed components. -
TypeScript:
Theme
type's generic argument is changed to be a union of string literals, rather than atypeof
constant string array; i.e. type definitions for themes should be updated in the following manner:Before:
import { type Theme } from '@dr.pogodin/react-themes'; const validKeys = ['keyA', 'keyB'] as const; type BaseComponentPropsT = { theme: Theme<typeof validKeys>; }; const BaseComponent: React.FunctionComponent<BaseComponentPropsT> = ... const ThemedComponent = themed(BaseComponent, 'ThemedComponent', validKeys);
Now:
import { type Theme } from '@dr.pogodin/react-themes'; type BaseComponentPropsT = { theme: Theme<'keyA' | 'keyB'>; }; const BaseComponent: React.FunctionComponent<BaseComponentPropsT> = ... const ThemedComponent = themed(BaseComponent, 'ThemedComponent');
-
Other Updates
- Update of dependencies.
v1.6.2
v1.6.1
- Update of dependencies.
v1.6.0
Breaking Changes
-
[#56] Typescript: Improves theme typing.
This is a breaking change for TypeScript projects, as it requires corresponding code updates.
Before:
import themed, { type Theme } from '@dr.pogodin/react-themes'; type ComponentPropsT = { theme: Theme & { keyA?: string; keyB?: string; }; }; const Component: React.FunctionComponent<ComponentPropsT> = ... const ThemedComponent = themed(Component, 'Component', [ 'keyA', 'keyB', ]);
Now:
import themed, { type Theme } from '@dr.pogodin/react-themes'; const validKeys = ['keyA', 'keyB'] as const; type ComponentPropsT = { theme: Theme<typeof validKeys>; }; const Component: React.FunctionComponent<ComponentPropsT> = ... const ThemedComponent = themed(Component, 'Component', validKeys);
Other Updates
- Updates dependencies.
v1.5.1
- TypeScript: Minor fixes.
v1.5.0
- [#55] Migrates the codebase to TypeScript (the packaged library now includes both JavaScript build with TS type definitions, and TypeScript sources).
- Drops «compatibility mode» (optional emulation of similar, older react-css-themr and react-css-super-themr libraries).
- Updates dependencies.
v1.4.9
- Updates dependencies.
v1.4.8
- Updates dependencies.
v1.4.7
- Updates dependencies.
v1.4.6
- Updates dependencies.