react-toolkit icon indicating copy to clipboard operation
react-toolkit copied to clipboard

fix(Restitution): fixed HeaderRestitution's type missing classModifier

Open JLou opened this issue 3 years ago • 0 comments

Related issue

Description of the issue

The outgoing type for HeaderRestitution was the base type and not the enhanced one with classModifier. image

Important

Before creating a pull request run unit tests

$ npm test

# watch for changes
$ npm test -- --watch

# For a specific file (e.g., in packages/context/__tests__/command.test.js)
$ npm test -- --watch packages/action

Current workaround :

interface HeaderRestitutionProps {
  className?: string;
  title: React.ReactNode;
  subtitle?: React.ReactNode;
  rightTitle?: React.ReactNode;
  classModifier?: string | null;
  defaultClassName?: string | null;
}
const HeaderRestitutionFixed: (props: HeaderRestitutionProps) => JSX.Element = HeaderRestitution as never;
        
const MyComponent = () => (
      <HeaderRestitutionFixed
          classModifier="stackedRight" // no error
      />
);

JLou avatar Oct 14 '22 08:10 JLou