Skip to content

Releases: birdofpreyru/react-themes

v1.7.0

18 Jun 23:42
Compare
Choose a tag to compare

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, and themeType field of themed components.

    • TypeScript: Theme type's generic argument is changed to be a union of string literals, rather than a typeof 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

03 Jun 22:12
Compare
Choose a tag to compare
  • [#61] Update of dependencies

v1.6.1

05 May 12:47
Compare
Choose a tag to compare
  • Update of dependencies.

v1.6.0

10 Jan 12:33
Compare
Choose a tag to compare

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

23 Oct 13:23
Compare
Choose a tag to compare
  • TypeScript: Minor fixes.

v1.5.0

22 Oct 23:57
Compare
Choose a tag to compare
  • [#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

18 Aug 12:26
Compare
Choose a tag to compare
  • Updates dependencies.

v1.4.8

04 Apr 16:57
Compare
Choose a tag to compare
  • Updates dependencies.

v1.4.7

16 Nov 14:27
Compare
Choose a tag to compare
  • Updates dependencies.

v1.4.6

05 Nov 18:42
Compare
Choose a tag to compare
  • Updates dependencies.