react-toolkit
react-toolkit copied to clipboard
fix(Restitution): fixed HeaderRestitution's type missing classModifier
Related issue
Description of the issue
The outgoing type for HeaderRestitution was the base type and not the enhanced one with classModifier.

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
/>
);