mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-08 13:52:36 +02:00
refactor: replace non-prop interface with type; allow plugin lifecycles to have sync type (#7080)
* refactor: replace non-prop interface with type; allow plugin lifecycles to have sync type * fix
This commit is contained in:
parent
ce2b631455
commit
24c205a835
38 changed files with 145 additions and 138 deletions
|
@ -9,14 +9,14 @@ import React, {type ReactNode, type ComponentProps} from 'react';
|
|||
import clsx from 'clsx';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
export interface SvgIconProps extends ComponentProps<'svg'> {
|
||||
export type SvgIconProps = ComponentProps<'svg'> & {
|
||||
viewBox?: string;
|
||||
size?: 'inherit' | 'small' | 'medium' | 'large';
|
||||
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'warning';
|
||||
svgClass?: string; // Class attribute on the child
|
||||
colorAttr?: string; // Applies a color attribute to the SVG element.
|
||||
children: ReactNode; // Node passed into the SVG element.
|
||||
}
|
||||
};
|
||||
|
||||
export default function Svg(props: SvgIconProps): JSX.Element {
|
||||
const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue